提交 7715dea4 编写于 作者: J John Keeping 提交者: Marek Vasut

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: NJohn Keeping <john@metanate.com>
Tested-by: NSteve Rae <steve.rae@raedomain.com>
上级 d3310842
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册