aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Keeping <john@metanate.com>2016-09-19 10:59:40 +0100
committerMarek Vasut <marex@denx.de>2017-08-21 11:31:10 +0200
commit7715dea48b5d17f6394d1a02c60a84278df71391 (patch)
tree87d0951d3ca38dfa6ef2fe63761d29b632193c59
parentd331084298002e5cc0a54abb5855be1fc69153c3 (diff)
downloadu-boot-7715dea48b5d17f6394d1a02c60a84278df71391.zip
u-boot-7715dea48b5d17f6394d1a02c60a84278df71391.tar.gz
u-boot-7715dea48b5d17f6394d1a02c60a84278df71391.tar.bz2
fastboot: avoid printing invalid data
There is no guarantee that commands are null-terminated in the USB request buffer, so limit the length of data that is printed. Signed-off-by: John Keeping <john@metanate.com> Tested-by: Steve Rae <steve.rae@raedomain.com>
-rw-r--r--drivers/usb/gadget/f_fastboot.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index aecee7f..199621d 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -718,7 +718,7 @@ static void rx_handler_command(struct usb_ep *ep, struct usb_request *req)
}
if (!func_cb) {
- error("unknown command: %s", cmdbuf);
+ error("unknown command: %.*s", req->actual, cmdbuf);
fastboot_tx_write_str("FAILunknown command");
} else {
if (req->actual < req->length) {