[dm-devel] [PATCH 12/12] libmultipath(coverity): fix possible NULL dereference

Martin Wilck mwilck at suse.com
Tue Jan 8 22:54:09 UTC 2019


coverity warns that recv_packet may set reply to NULL.

Signed-off-by: Martin Wilck <mwilck at suse.com>
---
 libmultipath/configure.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libmultipath/configure.c b/libmultipath/configure.c
index 64a1f7b..970b913 100644
--- a/libmultipath/configure.c
+++ b/libmultipath/configure.c
@@ -1042,7 +1042,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;
-- 
2.19.2




More information about the dm-devel mailing list