[sr-dev] git:master: Prevent NULL pointer dereference when rtype was incorrect

Marius Zbihlei marius.zbihlei at 1and1.ro
Fri Jan 14 16:26:38 CET 2011


Module: sip-router
Branch: master
Commit: f7c16aaa7eacf64ba17a54720db2f9a4b58ad134
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=f7c16aaa7eacf64ba17a54720db2f9a4b58ad134

Author: Marius Zbihlei <marius.zbihlei at 1and1.ro>
Committer: Marius Zbihlei <marius.zbihlei at 1and1.ro>
Date:   Fri Jan 14 17:20:40 2011 +0200

Prevent NULL pointer dereference when rtype was incorrect

Found with clang

---

 route.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/route.c b/route.c
index 46725ae..7a29ded 100644
--- a/route.c
+++ b/route.c
@@ -1754,7 +1754,7 @@ inline static int comp_ip(int op, struct ip_addr* ip, int rtype,
 		default:
 			LOG(L_CRIT, "BUG: comp_ip: invalid type for "
 						" src_ip or dst_ip (%d)\n", rtype);
-			ret=-1;
+			return -1;
 	}
 	/* here "right" is set to the str we compare with */
 	r_expop.str=*right;




More information about the sr-dev mailing list