projects
/
paraslash.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
46fe481
)
com_stat(): Be more anal in checking command line options.
author
Andre Noll
<maan@systemlinux.org>
Sun, 30 Aug 2009 12:26:32 +0000
(14:26 +0200)
committer
Andre Noll
<maan@systemlinux.org>
Sun, 30 Aug 2009 12:26:32 +0000
(14:26 +0200)
Also check the number of arguments and use para_atoi32 to convert
the argument into an int.
command.c
patch
|
blob
|
history
diff --git
a/command.c
b/command.c
index
e3b15a5
..
f61ea57
100644
(file)
--- a/
command.c
+++ b/
command.c
@@
-307,8
+307,13
@@
int com_stat(int fd, int argc, char * const * argv)
para_sigaction(SIGUSR1, dummy);
- if (argc > 1)
- num = atoi(argv[1]);
+ if (argc > 2)
+ return -E_COMMAND_SYNTAX;
+ if (argc > 1) {
+ ret = para_atoi32(argv[1], &num);
+ if (ret < 0)
+ goto out;
+ }
for (;;) {
mmd_dup(nmmd);