1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s3: in sys_popen(), validate input before opening the pipe.

This commit is contained in:
Michael Adam 2012-09-04 15:15:42 +02:00
parent e7d385c366
commit 243157ae34

View File

@ -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;