From 521485c8f25f55cb3045ab2b33232c7026d8527d Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Tue, 15 Jun 2021 09:54:32 +0200 Subject: [PATCH] nathelper: check length on new condition inside replace_sdp_ip() --- src/modules/nathelper/nathelper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/nathelper/nathelper.c b/src/modules/nathelper/nathelper.c index 5fb83cea462..df9a5bce2ca 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; }