Module: kamailio
Branch: master
Commit: 200cdb318569191cd012dfe99b252f98fe9623b9
URL:
https://github.com/kamailio/kamailio/commit/200cdb318569191cd012dfe99b252f9…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2025-01-26T18:07:54+01:00
core/parser/sdp: proper test for media ip separator
---
Modified: src/core/parser/sdp/sdp_helpr_funcs.c
---
Diff:
https://github.com/kamailio/kamailio/commit/200cdb318569191cd012dfe99b252f9…
Patch:
https://github.com/kamailio/kamailio/commit/200cdb318569191cd012dfe99b252f9…
---
diff --git a/src/core/parser/sdp/sdp_helpr_funcs.c
b/src/core/parser/sdp/sdp_helpr_funcs.c
index 61022b6148f..893ef0e58a4 100644
--- a/src/core/parser/sdp/sdp_helpr_funcs.c
+++ b/src/core/parser/sdp/sdp_helpr_funcs.c
@@ -561,7 +561,7 @@ int extract_mediaip(str *body, str *mediaip, int *pf, char *line)
* - for length, at least 6: ' IP[4|6] x...'
* - white space after
*/
- if(cp + 6 > mediaip->s + mediaip->len && cp[4] != ' ') {
+ if(cp + 6 > mediaip->s + mediaip->len || cp[4] != ' ') {
LM_ERR("invalid content for `%s' line\n", line);
return -1;
}