git.samba.org
/
bbaumbach
/
samba-autobuild
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e7d385c
)
s3: in sys_popen(), validate input before opening the pipe.
author
Michael Adam
<obnox@samba.org>
Tue, 4 Sep 2012 13:15:42 +0000
(15:15 +0200)
committer
Michael Adam
<obnox@samba.org>
Tue, 4 Sep 2012 18:39:20 +0000
(20:39 +0200)
source3/lib/system.c
patch
|
blob
|
history
diff --git
a/source3/lib/system.c
b/source3/lib/system.c
index 8c9c05f4de0fd7fd933dbb132e49704eef336b7f..ce55e83d583009f20e6f98d136dbfe75a68c10d6 100644
(file)
--- a/
source3/lib/system.c
+++ b/
source3/lib/system.c
@@
-1161,17
+1161,17
@@
int sys_popen(const char *command)
char **argl = NULL;
int ret;
+ if (!*command) {
+ errno = EINVAL;
+ return -1;
+ }
+
if (pipe(pipe_fds) < 0)
return -1;
parent_end = pipe_fds[0];
child_end = pipe_fds[1];
- if (!*command) {
- errno = EINVAL;
- goto err_exit;
- }
-
if((entry = SMB_MALLOC_P(popen_list)) == NULL)
goto err_exit;