]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[core] scan-build: Null pointer passed as an argument to a 'nonnull' parameter -... 277/head
authorDragos Oancea <dragos@signalwire.com>
Thu, 30 Jan 2020 21:56:44 +0000 (21:56 +0000)
committerDragos Oancea <dragos@signalwire.com>
Sun, 2 Feb 2020 16:54:04 +0000 (16:54 +0000)
src/switch_event.c

index 8b8d57250ca7cd054406636c18dff5d61c90fe46..c2b03b54a7e309da6c9a2680273b026b83fdc065 100644 (file)
@@ -1114,7 +1114,11 @@ static switch_status_t switch_event_base_add_header(switch_event_t *event, switc
        redraw:
                len = 0;
                for(j = 0; j < header->idx; j++) {
-                       len += strlen(header->array[j]) + 2;
+                       len += 2;
+                       if (!header->array[j]) { 
+                               continue;
+                       }
+                       len += strlen(header->array[j]);
                }
 
                if (len) {