[sr-dev] git:master:a48d87df: core: bug fix in str2ipbuf, return an error for invalid input parameter

Henning Westerholt hw at skalatan.de
Tue Nov 12 12:18:59 CET 2019


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

Author: Henning Westerholt <hw at skalatan.de>
Committer: Henning Westerholt <hw at skalatan.de>
Date: 2019-11-12T12:18:06+01:00

core: bug fix in str2ipbuf, return an error for invalid input parameter

---

Modified: src/core/resolve.c

---

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

---

diff --git a/src/core/resolve.c b/src/core/resolve.c
index ac9b2f2363..af269a2b42 100644
--- a/src/core/resolve.c
+++ b/src/core/resolve.c
@@ -1738,7 +1738,7 @@ int str2ipbuf(str* st, ip_addr_t* ipb)
 	/* 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;
+		return -1;
 	}
 	s=(unsigned char*)st->s;
 




More information about the sr-dev mailing list