]> git.sur5r.net Git - u-boot/commitdiff
tools, fit_info: increase buffer for command name
authorHeiko Schocher <hs@denx.de>
Mon, 11 Aug 2014 09:17:08 +0000 (11:17 +0200)
committerAnatolij Gustschin <agust@denx.de>
Thu, 14 Aug 2014 09:20:24 +0000 (11:20 +0200)
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

index 481ac6dd8147c3cab6261edab0f3c994911a2189..652abcd2bd15434b78298035e53a6d13c9b874e4 100644 (file)
@@ -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':