Module: kamailio
Branch: 5.3
Commit: ae7a6f6e0950dcfb13e421ed64da6d9cd023f58c
URL:
https://github.com/kamailio/kamailio/commit/ae7a6f6e0950dcfb13e421ed64da6d9…
Author: Henning Westerholt <hw(a)skalatan.de>
Committer: Henning Westerholt <hw(a)skalatan.de>
Date: 2019-11-12T12:20:53+01:00
core: bug fix in str2ipbuf, return an error for invalid input parameter
(cherry picked from commit a48d87dff0d266efabaf4b0312d2c228ccbd13ff)
---
Modified: src/core/resolve.c
---
Diff:
https://github.com/kamailio/kamailio/commit/ae7a6f6e0950dcfb13e421ed64da6d9…
Patch:
https://github.com/kamailio/kamailio/commit/ae7a6f6e0950dcfb13e421ed64da6d9…
---
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;