Skip to contentSkip to conversation

usb gadget: increase envstr size in cb_getvar

PATCH New Nicolas le bayon 3 participants 7 messages Sep 21, 2016 – Mar 10, 2017 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb gadget: increase envstr size in cb_getvar

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(-)
(quoted diff) +0 -0

b/drivers/usb/gadget/f_fastboot.c
index 2160b1c..84e22e4 100644

drivers/usb/gadget/f_fastboot.c +0 -0
@@ -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);

Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 usb gadget: increase envstr size in cb_getvar

Hi,

would it be possible to consider this patch please?

Best Regards
Nicolas

2016-09-21 10:43 GMT+02:00 Nicolas le bayon <[email protected]>:

Quoted 34 lines

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(-)
drivers/usb/gadget/f_ renamed from drivers/usb/gadget/f_fastboot.c +0 -0

fastboot.c
index 2160b1c..84e22e4 100644

drivers/usb/gadget/f_fastboot.c +1 -1
@@ -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

#2 lore raw

PATCH 1/1 usb gadget: increase envstr size in cb_getvar

Hi Nicolas,

+Marek on CC

Quoted 37 lines

Hi,

would it be possible to consider this patch please?

Best Regards
Nicolas

2016-09-21 10:43 GMT+02:00 Nicolas le bayon <[email protected]>:

Quoted 28 lines

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(-)
drivers/usb/gadget/f_ renamed from drivers/usb/gadget/f_fastboot.c +0 -0

fastboot.c
index 2160b1c..84e22e4 100644

drivers/usb/gadget/f_fastboot.c +1 -1
@@ -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];
 
Quoted 11 lines
Quoted 7 lines
drivers/usb/gadget/f_fastboot.c +0 -0
  snprintf(envstr, sizeof(envstr) - 1, "fastboot.%s", cmd);

s = getenv(envstr);
--
1.9.1

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/listinfo/u-boot

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de

#3 lore raw

PATCH 1/1 usb gadget: increase envstr size in cb_getvar

Quoted 3 lines · Lukasz Majewski

Hi Nicolas,

+Marek on CC

Lukasz, this is gadget stuff, so it's up to you to handle it.

Quoted 38 lines
Quoted 38 lines

Hi,

would it be possible to consider this patch please?

Best Regards
Nicolas

2016-09-21 10:43 GMT+02:00 Nicolas le bayon <[email protected]>:

Quoted 28 lines

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(-)
drivers/usb/gadget/f_ renamed from drivers/usb/gadget/f_fastboot.c +0 -0

fastboot.c
index 2160b1c..84e22e4 100644

drivers/usb/gadget/f_fastboot.c +1 -1
@@ -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];
 
Quoted 1 line
Quoted 1 line

drivers/usb/gadget/f_fastboot.c static void cb_getvar(struct usb_ep *ep, struct · line 438

Quoted 1 line
drivers/usb/gadget/f_fastboot.c +0 -0
  snprintf(envstr, sizeof(envstr) - 1, "fastboot.%s", cmd);

What about using asprintf() or somesuch ?

Quoted 24 lines
Quoted 10 lines
Quoted 6 lines

s = getenv(envstr);
--
1.9.1

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/listinfo/u-boot

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de

#4 lore raw

PATCH 1/1 usb gadget: increase envstr size in cb_getvar

2017-03-05 1:54 GMT+01:00 Marek Vasut <[email protected]>:

Quoted 48 lines · Lukasz Majewski
Quoted 5 lines

Hi Nicolas,

+Marek on CC

Lukasz, this is gadget stuff, so it's up to you to handle it.

Quoted 37 lines

Hi,

Quoted 36 lines

would it be possible to consider this patch please?

Best Regards
Nicolas

2016-09-21 10:43 GMT+02:00 Nicolas le bayon <[email protected]>:

Hi,

Quoted 27 lines

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(-)
drivers/usb/gadget/f_ renamed from drivers/usb/gadget/f_fastboot.c +0 -0

fastboot.c
index 2160b1c..84e22e4 100644

drivers/usb/gadget/f_fastboot.c +1 -1
@@ -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];
 
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines

drivers/usb/gadget/f_fastboot.c static void cb_getvar(struct usb_ep *ep, struct · line 438

Quoted 2 lines
drivers/usb/gadget/f_fastboot.c +0 -0
  snprintf(envstr, sizeof(envstr) - 1, "fastboot.%s", cmd);

What about using asprintf() or somesuch ?

It would be a nice idea, but the asprintf function is not available unfortunately.

Quoted 28 lines

s = getenv(envstr);

Quoted 25 lines
Quoted 10 lines
Quoted 6 lines

--
1.9.1

_______________________________________________

U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/listinfo/u-boot

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de

#5 lore raw

PATCH 1/1 usb gadget: increase envstr size in cb_getvar

Quoted 50 lines · Nicolas le bayon

2017-03-05 1:54 GMT+01:00 Marek Vasut <[email protected]>:

Quoted 48 lines · Lukasz Majewski
Quoted 5 lines

Hi Nicolas,

+Marek on CC

Lukasz, this is gadget stuff, so it's up to you to handle it.

Quoted 37 lines

Hi,

Quoted 36 lines

would it be possible to consider this patch please?

Best Regards
Nicolas

2016-09-21 10:43 GMT+02:00 Nicolas le bayon <[email protected]>:

Hi,

Quoted 27 lines

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(-)
drivers/usb/gadget/f_ renamed from drivers/usb/gadget/f_fastboot.c +0 -0

fastboot.c
index 2160b1c..84e22e4 100644

drivers/usb/gadget/f_fastboot.c +1 -1
@@ -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];
 
Quoted 8 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines

drivers/usb/gadget/f_fastboot.c static void cb_getvar(struct usb_ep *ep, struct · line 438

Quoted 2 lines
drivers/usb/gadget/f_fastboot.c +0 -0
  snprintf(envstr, sizeof(envstr) - 1, "fastboot.%s", cmd);

What about using asprintf() or somesuch ?

It would be a nice idea, but the asprintf function is not available unfortunately.

Well, then use malloc + sprintf ...

Signature · 2 lines
Best regards,
Marek Vasut
#6 lore raw

PATCH 1/1 usb gadget: increase envstr size in cb_getvar

In reply to Nicolas le bayon
Quoted 50 lines · Nicolas le bayon

2017-03-05 1:54 GMT+01:00 Marek Vasut <[email protected]>:

Quoted 48 lines · Lukasz Majewski
Quoted 5 lines

Hi Nicolas,

+Marek on CC

Lukasz, this is gadget stuff, so it's up to you to handle it.

Quoted 37 lines

Hi,

Quoted 36 lines

would it be possible to consider this patch please?

Best Regards
Nicolas

2016-09-21 10:43 GMT+02:00 Nicolas le bayon <[email protected]>:

Hi,

Quoted 27 lines

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(-)
drivers/usb/gadget/f_ renamed from drivers/usb/gadget/f_fastboot.c +0 -0

fastboot.c
index 2160b1c..84e22e4 100644

drivers/usb/gadget/f_fastboot.c +1 -1
@@ -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];
 
Quoted 8 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines

drivers/usb/gadget/f_fastboot.c static void cb_getvar(struct usb_ep *ep, struct · line 438

Quoted 2 lines
drivers/usb/gadget/f_fastboot.c +0 -0
  snprintf(envstr, sizeof(envstr) - 1, "fastboot.%s", cmd);

What about using asprintf() or somesuch ?

It would be a nice idea, but the asprintf function is not available unfortunately.

Well, then use malloc + snprintf ...

Signature · 2 lines
Best regards,
Marek Vasut