Browse Source

core/parser/sdp: proper test for media ip separator

Daniel-Constantin Mierla 7 months ago
parent
commit
200cdb3185
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/core/parser/sdp/sdp_helpr_funcs.c

+ 1 - 1
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...'
 	 * - for length, at least 6: ' IP[4|6] x...'
 	 * - white space after
 	 * - 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);
 		LM_ERR("invalid content for `%s' line\n", line);
 		return -1;
 		return -1;
 	}
 	}