public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] tools, fit_info: increase buffer for command name
@ 2014-08-11  9:17 Heiko Schocher
  2014-08-11 17:15 ` Simon Glass
  2014-08-14  9:28 ` Anatolij Gustschin
  0 siblings, 2 replies; 3+ messages in thread
From: Heiko Schocher @ 2014-08-11  9:17 UTC (permalink / raw)
  To: u-boot

currently the buffer for command name is 50 bytes only. If using
fit_info with long absolute paths, this is not enough, so raise
it to 256 (as it is in fit_check_sign)

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Simon Glass <sjg@chromium.org>
---
 tools/fit_info.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/fit_info.c b/tools/fit_info.c
index 481ac6d..652abcd 100644
--- a/tools/fit_info.c
+++ b/tools/fit_info.c
@@ -48,10 +48,11 @@ int main(int argc, char **argv)
 	char *fdtfile = NULL;
 	char *nodename = NULL;
 	char *propertyname = NULL;
-	char cmdname[50];
+	char cmdname[256];
 	int c;
 
-	strcpy(cmdname, *argv);
+	strncpy(cmdname, *argv, sizeof(cmdname) - 1);
+	cmdname[sizeof(cmdname) - 1] = '\0';
 	while ((c = getopt(argc, argv, "f:n:p:")) != -1)
 		switch (c) {
 		case 'f':
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] tools, fit_info: increase buffer for command name
  2014-08-11  9:17 [U-Boot] [PATCH] tools, fit_info: increase buffer for command name Heiko Schocher
@ 2014-08-11 17:15 ` Simon Glass
  2014-08-14  9:28 ` Anatolij Gustschin
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2014-08-11 17:15 UTC (permalink / raw)
  To: u-boot

On 11 August 2014 03:17, Heiko Schocher <hs@denx.de> wrote:
> currently the buffer for command name is 50 bytes only. If using
> fit_info with long absolute paths, this is not enough, so raise
> it to 256 (as it is in fit_check_sign)
>
> Signed-off-by: Heiko Schocher <hs@denx.de>
> Cc: Simon Glass <sjg@chromium.org>

Acked-by: Simon Glass <sjg@chromium.org>

> ---
>  tools/fit_info.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/tools/fit_info.c b/tools/fit_info.c
> index 481ac6d..652abcd 100644
> --- a/tools/fit_info.c
> +++ b/tools/fit_info.c
> @@ -48,10 +48,11 @@ int main(int argc, char **argv)
>         char *fdtfile = NULL;
>         char *nodename = NULL;
>         char *propertyname = NULL;
> -       char cmdname[50];
> +       char cmdname[256];
>         int c;
>
> -       strcpy(cmdname, *argv);
> +       strncpy(cmdname, *argv, sizeof(cmdname) - 1);
> +       cmdname[sizeof(cmdname) - 1] = '\0';
>         while ((c = getopt(argc, argv, "f:n:p:")) != -1)
>                 switch (c) {
>                 case 'f':
> --
> 1.8.3.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] tools, fit_info: increase buffer for command name
  2014-08-11  9:17 [U-Boot] [PATCH] tools, fit_info: increase buffer for command name Heiko Schocher
  2014-08-11 17:15 ` Simon Glass
@ 2014-08-14  9:28 ` Anatolij Gustschin
  1 sibling, 0 replies; 3+ messages in thread
From: Anatolij Gustschin @ 2014-08-14  9:28 UTC (permalink / raw)
  To: u-boot

On Mon, 11 Aug 2014 11:17:08 +0200
Heiko Schocher <hs@denx.de> wrote:

> currently the buffer for command name is 50 bytes only. If using
> fit_info with long absolute paths, this is not enough, so raise
> it to 256 (as it is in fit_check_sign)
> 
> Signed-off-by: Heiko Schocher <hs@denx.de>
> Cc: Simon Glass <sjg@chromium.org>
> ---
>  tools/fit_info.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

applied to u-boot-staging/agust at denx.de. thanks!

Anatolij

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-14  9:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-11  9:17 [U-Boot] [PATCH] tools, fit_info: increase buffer for command name Heiko Schocher
2014-08-11 17:15 ` Simon Glass
2014-08-14  9:28 ` Anatolij Gustschin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox