Module: kamailio Branch: master Commit: ade1cad69b659e5b0923e548d3c04f550204e793 URL: https://github.com/kamailio/kamailio/commit/ade1cad69b659e5b0923e548d3c04f55...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2018-07-11T15:25:56+02:00
nathelper: safety check for sipping_from when building SIP keepalive request
- reported by GH #1587
---
Modified: src/modules/nathelper/sip_pinger.h
---
Diff: https://github.com/kamailio/kamailio/commit/ade1cad69b659e5b0923e548d3c04f55... Patch: https://github.com/kamailio/kamailio/commit/ade1cad69b659e5b0923e548d3c04f55...
---
diff --git a/src/modules/nathelper/sip_pinger.h b/src/modules/nathelper/sip_pinger.h index 4277b407e2..23ea633d03 100644 --- a/src/modules/nathelper/sip_pinger.h +++ b/src/modules/nathelper/sip_pinger.h @@ -127,6 +127,10 @@ static inline char *build_sipping(str *curi, struct socket_info *s, str *path, str vaddr; str vport;
+ if(sipping_from.s==NULL || sipping_from.len<=0) { + LM_WARN("SIP ping enabled but no SIP ping From address\n"); + return NULL; + } if(s->useinfo.name.len > 0) vaddr = s->useinfo.name; else @@ -206,4 +210,4 @@ static inline char *build_sipping(str *curi, struct socket_info *s, str *path, return buf; }
-#endif \ No newline at end of file +#endif