[sr-dev] git:master:55d115e2: core: dns name to IP conversion - actually stop processing in error case

Henning Westerholt hw at kamailio.org
Sun Jun 10 22:41:49 CEST 2018


Module: kamailio
Branch: master
Commit: 55d115e255b1d87121922f689b93870b84e1b2b4
URL: https://github.com/kamailio/kamailio/commit/55d115e255b1d87121922f689b93870b84e1b2b4

Author: Henning Westerholt <hw at kamailio.org>
Committer: Henning Westerholt <hw at kamailio.org>
Date: 2018-06-10T22:39:35+02:00

core: dns name to IP conversion - actually stop processing in error case

---

Modified: src/core/resolve.h

---

Diff:  https://github.com/kamailio/kamailio/commit/55d115e255b1d87121922f689b93870b84e1b2b4.diff
Patch: https://github.com/kamailio/kamailio/commit/55d115e255b1d87121922f689b93870b84e1b2b4.patch

---

diff --git a/src/core/resolve.h b/src/core/resolve.h
index e0089d0a19..6b1e6cff24 100644
--- a/src/core/resolve.h
+++ b/src/core/resolve.h
@@ -226,6 +226,7 @@ static inline struct ip_addr* str2ip(str* st)
 	/* 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");
+		return 0;
 	}
 	s=(unsigned char*)st->s;
 
@@ -280,6 +281,7 @@ static inline struct ip_addr* str2ip6(str* st)
 	/* 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");
+		return 0;
 	}
 	/* init */
 	if ((st->len) && (st->s[0]=='[')){




More information about the sr-dev mailing list