diff options
| author | paco <paco@voltanet.io> | 2018-06-21 17:34:16 +0200 |
|---|---|---|
| committer | paco <paco@voltanet.io> | 2018-06-21 17:35:38 +0200 |
| commit | d1f92e454c24a4ac96d930ae35f0fa38cc8e60f6 (patch) | |
| tree | 326fa80f41ae19af02aa97aa4e01283182fb522d | |
| parent | eab268594a59c9cdf248da0e10dbc79707113d25 (diff) | |
lib: null check (Coverity 1399277)
Signed-off-by: F. Aragon <paco@voltanet.io>
| -rw-r--r-- | lib/sockunion.c | 3 |
1 files changed, 3 insertions, 0 deletions
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); |
