libmultipath(coverity): fix possible NULL dereference
authorMartin Wilck <mwilck@suse.com>
Tue, 8 Jan 2019 22:54:09 +0000 (23:54 +0100)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Sat, 19 Jan 2019 10:52:04 +0000 (11:52 +0100)
coverity warns that recv_packet may set reply to NULL.

Signed-off-by: Martin Wilck <mwilck@suse.com>
libmultipath/configure.c

index 39d2a95..af4d78d 100644 (file)
@@ -1041,7 +1041,7 @@ int check_daemon(void)
        if (recv_packet(fd, &reply, timeout) != 0)
                goto out;
 
-       if (strstr(reply, "shutdown"))
+       if (reply && strstr(reply, "shutdown"))
                goto out_free;
 
        ret = 1;