From: Fabian Keil <fk@fabiankeil.de>
Date: Sun, 4 Jun 2017 14:42:54 +0000 (+0000)
Subject: Let sockaddr_storage_to_ip() assert that addr isn't NULL
X-Git-Tag: v_3_0_27~135
X-Git-Url: http://www.privoxy.org/gitweb/%22https:/@default-cgi@/user-manual/faq/static/@default-cgi@show-status?a=commitdiff_plain;h=ac4021e8a919ef7f9308c28204ade61466a73541;p=privoxy.git

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.
---

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)
    {