Module: kamailio Branch: master Commit: 521485c8f25f55cb3045ab2b33232c7026d8527d URL: https://github.com/kamailio/kamailio/commit/521485c8f25f55cb3045ab2b33232c70...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2021-06-15T09:54:32+02:00
nathelper: check length on new condition inside replace_sdp_ip()
---
Modified: src/modules/nathelper/nathelper.c
---
Diff: https://github.com/kamailio/kamailio/commit/521485c8f25f55cb3045ab2b33232c70... Patch: https://github.com/kamailio/kamailio/commit/521485c8f25f55cb3045ab2b33232c70...
---
diff --git a/src/modules/nathelper/nathelper.c b/src/modules/nathelper/nathelper.c index 5fb83cea46..df9a5bce2c 100644 --- a/src/modules/nathelper/nathelper.c +++ b/src/modules/nathelper/nathelper.c @@ -1696,7 +1696,7 @@ static inline int replace_sdp_ip( hasreplaced = 1; body1 = body2; } - if(!hasreplaced && memcmp("a=rtcp", line, 6) != 0) { + if(!hasreplaced && linelen>=6 && memcmp("a=rtcp", line, 6)!=0) { LM_ERR("can't extract '%s' IP from the SDP\n", line); return -1; }