From af643cb3a2863134b1a6bbeaa99fec07025e7292 Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Wed, 15 Feb 2023 15:18:15 +0100 Subject: [PATCH] MT#56128 Fix a defect detected by the CoverityScan *** CID 1534508: Null pointer dereferences (FORWARD_NULL) /daemon/call_interfaces.c: 614 in ng_sdp_attr_manipulations() 608 609 INLINE void ng_sdp_attr_manipulations(GQueue *sdp_attr_manipulations, bencode_item_t *value) { 610 611 if (!value || value->type != BENCODE_DICTIONARY) 612 ilog(LOG_WARN, "SDP manipulations: Wrong type for this type of command."); 613 >>> CID 1534508: Null pointer dereferences (FORWARD_NULL) >>> Dereferencing null pointer "value". 614 for (bencode_item_t *it = value->child; it; it = it->sibling) 615 { 616 bencode_item_t *command_action = it->sibling ? it->sibling : NULL; 617 enum media_type media; 618 str media_type; 619 Change-Id: Iba634f785f3a235098bf5794c770132e2723d899 --- daemon/call_interfaces.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/daemon/call_interfaces.c b/daemon/call_interfaces.c index f3c1494a8..6d0382f25 100644 --- a/daemon/call_interfaces.c +++ b/daemon/call_interfaces.c @@ -608,8 +608,10 @@ INLINE void ng_osrtp_option(struct sdp_ng_flags *out, str *s, void *dummy) { INLINE void ng_sdp_attr_manipulations(GQueue *sdp_attr_manipulations, bencode_item_t *value) { - if (!value || value->type != BENCODE_DICTIONARY) + if (!value || value->type != BENCODE_DICTIONARY) { ilog(LOG_WARN, "SDP manipulations: Wrong type for this type of command."); + return; + } for (bencode_item_t *it = value->child; it; it = it->sibling) {