From: paco Date: Thu, 21 Jun 2018 15:34:16 +0000 (+0200) Subject: lib: null check (Coverity 1399277) X-Git-Tag: frr-6.1-dev~271^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=d1f92e454c24a4ac96d930ae35f0fa38cc8e60f6;p=matthieu%2Ffrr.git lib: null check (Coverity 1399277) Signed-off-by: F. Aragon --- diff --git a/lib/sockunion.c b/lib/sockunion.c index 28a7f647cb..44378b5363 100644 --- a/lib/sockunion.c +++ b/lib/sockunion.c @@ -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);