Module: kamailio
Branch: master
Commit: 1d7d78c31eeab717c7013a00650d3cb07895bac8
URL:
https://github.com/kamailio/kamailio/commit/1d7d78c31eeab717c7013a00650d3cb…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-03-29T09:56:36+02:00
ipops: proper handling of return code for ip to buf conversion
- reported in GH #2695
---
Modified: src/modules/ipops/ipops_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/1d7d78c31eeab717c7013a00650d3cb…
Patch:
https://github.com/kamailio/kamailio/commit/1d7d78c31eeab717c7013a00650d3cb…
---
diff --git a/src/modules/ipops/ipops_mod.c b/src/modules/ipops/ipops_mod.c
index cb7422b988..273f232fa7 100644
--- a/src/modules/ipops/ipops_mod.c
+++ b/src/modules/ipops/ipops_mod.c
@@ -1105,15 +1105,15 @@ static inline ip_addr_t *strtoipX(str *ips)
{
/* IPv6 */
if(str2ip6buf(ips, &ipb) < 0) {
- return &ipb;
+ return NULL;
}
} else {
/* IPv4 */
if (str2ipbuf(ips, &ipb)<0) {
- return &ipb;
+ return NULL;
}
}
- return NULL;
+ return &ipb;
}
static int ki_dns_sys_match_ip(sip_msg_t *msg, str *vhn, str *vip)