Browse Source

MT#58441 Coverity Scan report introduced by 1bf894c

This is a fix for the following found defect:

*** CID 1568540:  Null pointer dereferences  (REVERSE_INULL)
/daemon/sdp.c: 2065 in insert_codec_parameters()
2059     						pt->payload_type,
2060     						STR_FMT(&pt->format_parameters));
2061     			}
2062     			if (s_dst->len) {
2063     				/* append to the chop->output */
2064     				append_attr_to_gstring(s, s_dst->str, NULL, flags,
>>>     CID 1568540:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "cm" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
2065     							(cm ? cm->type_id : MT_UNKNOWN));
2066     			}
2067     			g_string_free(s_dst, TRUE);
2068     		}
2069
2070     		/* rtcp-fb */

Change-Id: I309fd6268b889ceaf32a58d2fbe17a8c891a95d6
pull/1747/head
Donat Zenichev 2 years ago
parent
commit
f636f54a2f
1 changed files with 3 additions and 6 deletions
  1. +3
    -6
      daemon/sdp.c

+ 3
- 6
daemon/sdp.c View File

@ -2042,8 +2042,7 @@ static void insert_codec_parameters(GString *s, struct call_media *cm,
pt->payload_type,
STR_FMT(&pt->encoding_with_params));
/* append to the chop->output */
append_attr_to_gstring(s, s_dst->str, NULL, flags,
(cm ? cm->type_id : MT_UNKNOWN));
append_attr_to_gstring(s, s_dst->str, NULL, flags, cm->type_id);
g_string_truncate(s_dst, 0);
}
@ -2066,8 +2065,7 @@ static void insert_codec_parameters(GString *s, struct call_media *cm,
}
if (s_dst->len) {
/* append to the chop->output */
append_attr_to_gstring(s, s_dst->str, NULL, flags,
(cm ? cm->type_id : MT_UNKNOWN));
append_attr_to_gstring(s, s_dst->str, NULL, flags, cm->type_id);
}
g_string_truncate(s_dst, 0);
}
@ -2081,8 +2079,7 @@ static void insert_codec_parameters(GString *s, struct call_media *cm,
pt->payload_type,
STR_FMT(fb));
/* append to the chop->output */
append_attr_to_gstring(s, s_dst->str, NULL, flags,
(cm ? cm->type_id : MT_UNKNOWN));
append_attr_to_gstring(s, s_dst->str, NULL, flags, cm->type_id);
}
}


Loading…
Cancel
Save