Let sockaddr_storage_to_ip() assert that addr isn't NULL
authorFabian Keil <fk@fabiankeil.de>
Sun, 4 Jun 2017 14:42:54 +0000 (14:42 +0000)
committerFabian Keil <fk@fabiankeil.de>
Sun, 4 Jun 2017 14:42:54 +0000 (14:42 +0000)
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

index 49a9e89..2ae03de 100644 (file)
--- 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)
    {