]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: null check (Coverity 1399277)
authorpaco <paco@voltanet.io>
Thu, 21 Jun 2018 15:34:16 +0000 (17:34 +0200)
committerpaco <paco@voltanet.io>
Thu, 21 Jun 2018 15:35:38 +0000 (17:35 +0200)
Signed-off-by: F. Aragon <paco@voltanet.io>
lib/sockunion.c

index 28a7f647cba7faf80c1fef56da5b8f42a8c3045c..44378b536303060f9aaf3999ddac6994c76e694b 100644 (file)
@@ -46,6 +46,9 @@ int str2sockunion(const char *str, union sockunion *su)
 {
        int ret;
 
+       if (str == NULL)
+               return -1;
+
        memset(su, 0, sizeof(union sockunion));
 
        ret = inet_pton(AF_INET, str, &su->sin.sin_addr);