summaryrefslogtreecommitdiff
path: root/jffsX-utils/jffs2dump.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-01-25 14:46:31 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-02-09 22:13:18 +0100
commit3ea4705086b9b26a4acde7e83eb05be248ade503 (patch)
treeb232ba409c3cb9b14b42d5f7ac93545a3a16d34e /jffsX-utils/jffs2dump.c
parentdcfd984d8e09db9d5a7b4d121d914442966c254f (diff)
mtd-utils: Add checks to code that copies strings into fixed sized buffers
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'jffsX-utils/jffs2dump.c')
-rw-r--r--jffsX-utils/jffs2dump.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/jffsX-utils/jffs2dump.c b/jffsX-utils/jffs2dump.c
index ad7a9e3..d30b59f 100644
--- a/jffsX-utils/jffs2dump.c
+++ b/jffsX-utils/jffs2dump.c
@@ -149,7 +149,8 @@ static void process_options (int argc, char *argv[])
break;
case 'e':
convertendian = 1;
- strcpy (cnvfile, optarg);
+ strncpy (cnvfile, optarg, sizeof(cnvfile) - 1);
+ cnvfile[sizeof(cnvfile) - 1] = '\0';
break;
case 'r':
recalccrc = 1;