lib: Fix CID 1445648 Null pointer dereferences
authorVolker Lendecke <vl@samba.org>
Tue, 28 May 2019 06:49:52 +0000 (08:49 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 28 May 2019 20:27:14 +0000 (20:27 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/util/sys_popen.c

index 659e99ba73637d6bb8947f0495814025117388d7..f62199b42ffe0cdbdd0da1521e960432257044ae 100644 (file)
@@ -44,13 +44,14 @@ int sys_popenv(char * const argl[])
        int parent_end, child_end;
        int pipe_fds[2];
        popen_list *entry = NULL;
-       const char *command = argl[0];
+       const char *command = NULL;
        int ret;
 
        if (argl == NULL) {
                errno = EINVAL;
                return -1;
        }
+       command = argl[0];
 
        if (!*command) {
                errno = EINVAL;