Module: kamailio Branch: master Commit: 4a55a2b40b91f282d7fd8f0e3c3ae22bcf56d9dc URL: https://github.com/kamailio/kamailio/commit/4a55a2b40b91f282d7fd8f0e3c3ae22bcf56d9dc
Author: Henning Westerholt <[email protected]> Committer: Henning Westerholt <[email protected]> Date: 2018-06-08T21:16:51+02:00 core: make dns name to IP conversion more robust for IPv4 and IPv6 --- Modified: src/core/resolve.h --- Diff: https://github.com/kamailio/kamailio/commit/4a55a2b40b91f282d7fd8f0e3c3ae22bcf56d9dc.diff Patch: https://github.com/kamailio/kamailio/commit/4a55a2b40b91f282d7fd8f0e3c3ae22bcf56d9dc.patch --- diff --git a/src/core/resolve.h b/src/core/resolve.h index fad783e4e6..30cce19581 100644 --- a/src/core/resolve.h +++ b/src/core/resolve.h @@ -229,6 +229,10 @@ static inline struct ip_addr* str2ip(str* st) static struct ip_addr ip; unsigned char* s; + /* just in case that e.g. the VIA parser get confused */ + if(unlikely(!st->s || st->len <= 0)) { + LM_ERR("invalid name, no conversion to IP address possible\n"); + } s=(unsigned char*)st->s; /*init*/ @@ -281,6 +285,10 @@ static inline struct ip_addr* str2ip6(str* st) unsigned char* limit; unsigned char* s; + /* just in case that e.g. the VIA parser get confused */ + if(unlikely(!st->s || st->len <= 0)) { + LM_ERR("invalid name, no conversion to IP address possible\n"); + } /* init */ if ((st->len) && (st->s[0]=='[')){ /* skip over [ ] */ _______________________________________________ Kamailio (SER) - Development Mailing List [email protected] https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
