From ac4021e8a919ef7f9308c28204ade61466a73541 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Sun, 4 Jun 2017 14:42:54 +0000 Subject: [PATCH] Let sockaddr_storage_to_ip() assert that addr isn't NULL Calling the function with a NULL pointer is unreasonable, we currently don't do it (intentionally) and shouldn't start to do it (intentionally) in the future. --- filters.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/filters.c b/filters.c index 49a9e893..2ae03ded 100644 --- a/filters.c +++ b/filters.c @@ -1,4 +1,4 @@ -const char filters_rcs[] = "$Id: filters.c,v 1.203 2016/12/24 16:00:49 fabiankeil Exp $"; +const char filters_rcs[] = "$Id: filters.c,v 1.204 2017/03/08 13:13:18 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/filters.c,v $ @@ -112,10 +112,7 @@ static int sockaddr_storage_to_ip(const struct sockaddr_storage *addr, uint8_t **ip, unsigned int *len, in_port_t **port) { - if (NULL == addr) - { - return(-1); - } + assert(NULL != addr); switch (addr->ss_family) { -- 2.39.2