summaryrefslogtreecommitdiffstats
path: root/tools/fit_info.c
diff options
context:
space:
mode:
authorHeiko Schocher <hs@denx.de>2014-08-11 11:17:08 +0200
committerAnatolij Gustschin <agust@denx.de>2014-08-14 11:20:24 +0200
commit686dca0fc4eb077b089c7507f899097d001c8ce3 (patch)
treec92352b8b862bcb86ff6977e4a387de6b2e4fea1 /tools/fit_info.c
parent04a710a593138a0a3cfe88cd3a0ba036973a9fda (diff)
downloadtalos-obmc-uboot-686dca0fc4eb077b089c7507f899097d001c8ce3.tar.gz
talos-obmc-uboot-686dca0fc4eb077b089c7507f899097d001c8ce3.zip
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 <hs@denx.de> Cc: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/fit_info.c')
-rw-r--r--tools/fit_info.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/fit_info.c b/tools/fit_info.c
index 481ac6dd81..652abcd2bd 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':
OpenPOWER on IntegriCloud