projects
/
sxemacs
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2f898f9
)
Coverity: CID 400031: Tainted string
author
Nelson Ferreira
<nelson.ferreira@ieee.org>
Mon, 5 Mar 2012 18:11:52 +0000
(13:11 -0500)
committer
Nelson Ferreira
<nelson.ferreira@ieee.org>
Mon, 5 Mar 2012 18:11:52 +0000
(13:11 -0500)
* lib-src/yow.c (main): Make sure argv[2] is not NULL before copying
Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
lib-src/yow.c
patch
|
blob
|
history
diff --git
a/lib-src/yow.c
b/lib-src/yow.c
index
9d66d72
..
934f976
100644
(file)
--- a/
lib-src/yow.c
+++ b/
lib-src/yow.c
@@
-49,8
+49,8
@@
main(int argc, char *argv[])
char file[BUFSIZ];
if (argc > 2 && !strcmp(argv[1], "-f")) {
-
xstrncpy(file, argv[2], sizeof(file)-1
);
-
file[sizeof(file)-1]='\0'
;
+
assert(argv[2] != NULL
);
+
xstrncpy(file, argv[2], sizeof(file))
;
} else {
#ifdef PATH_DATA
#ifdef vms