projects
/
paraslash.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5ebdf3a
)
server: Avoid invalid free() in com_help().
author
Andre Noll
<maan@systemlinux.org>
Thu, 3 Feb 2011 08:12:39 +0000
(09:12 +0100)
committer
Andre Noll
<maan@systemlinux.org>
Thu, 3 Feb 2011 08:12:39 +0000
(09:12 +0100)
If the argument to com_help is not a valid command, we try to free
uninitialized memory which may lead to a segfault.
This bug existed at least since day 1 of the git repo.
command.c
patch
|
blob
|
history
diff --git
a/command.c
b/command.c
index
f61ea57
..
1810e5b
100644
(file)
--- a/
command.c
+++ b/
command.c
@@
-387,10
+387,8
@@
int com_help(int fd, int argc, char * const * argv)
}
/* argument given for help */
cmd = get_cmd_ptr(argv[1], &handler);
- if (!cmd) {
- free(handler);
+ if (!cmd)
return -E_BAD_CMD;
- }
perms = cmd_perms_itohuman(cmd->perms);
ret = send_va_buffer(fd,
"%s - %s\n\n"