tools, fit_info: increase buffer for command name
PATCH 1/1 tools, fit_info: increase buffer for command name
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 <[email protected]>
Cc Simon Glass <[email protected]>
--- tools/fit_info.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
tools/fit_info.c +3 -2
@@ -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' :
Signature · 1 line
1.8.3.1
PATCH 1/1 tools, fit_info: increase buffer for command name
Quoted 6 lines · Heiko Schocher
currently the buffer for command name is 50 bytes only. If using
fit_infowith long absolute paths, this is not enough, so raise it to 256 (as it is infit_check_sign)Signed-off-by Heiko Schocher <[email protected]>Cc Simon Glass <[email protected]>
Acked-by Simon Glass <[email protected]>
Quoted 25 lines
--- tools/fit_info.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)tools/fit_info.c +3
-3@@ -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
PATCH 1/1 tools, fit_info: increase buffer for command name
In reply to Heiko SchocherQuoted 9 lines · On Mon, 11 Aug 2014 11:17:08 +0200 Heiko Schocher <[email protected]> wrote:
currently the buffer for command name is 50 bytes only. If using
fit_infowith long absolute paths, this is not enough, so raise it to 256 (as it is infit_check_sign)Signed-off-by Heiko Schocher <[email protected]>Cc Simon Glass <[email protected]>--- tools/fit_info.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
applied to u-boot-staging/agust at denx.de. thanks!
Anatolij