From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas le bayon Date: Wed, 21 Sep 2016 10:43:27 +0200 Subject: [U-Boot] [PATCH] usb gadget: increase envstr size in cb_getvar Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, I propose you this patch in order to take into account strings larger than actual size (32). I recently faced to 'fastboot.partition-type:userdata' (it was in Android context) but this could be the case for other purposes. I propose to simply double the size. Is it ok for you? Regards --- drivers/usb/gadget/f_fastboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c index 2160b1c..84e22e4 100644 --- a/drivers/usb/gadget/f_fastboot.c +++ b/drivers/usb/gadget/f_fastboot.c @@ -432,7 +432,7 @@ static void cb_getvar(struct usb_ep *ep, struct usb_request *req) else strcpy(response, "FAILValue not set"); } else { - char envstr[32]; + char envstr[64]; snprintf(envstr, sizeof(envstr) - 1, "fastboot.%s", cmd); s = getenv(envstr); -- 1.9.1