Module: kamailio
Branch: master
Commit: a48d87dff0d266efabaf4b0312d2c228ccbd13ff
URL:
https://github.com/kamailio/kamailio/commit/a48d87dff0d266efabaf4b0312d2c22…
Author: Henning Westerholt <hw(a)skalatan.de>
Committer: Henning Westerholt <hw(a)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/a48d87dff0d266efabaf4b0312d2c22…
Patch:
https://github.com/kamailio/kamailio/commit/a48d87dff0d266efabaf4b0312d2c22…
---
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;