]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[Core] Coverity: 1060958 Dereference before null check time_t
authorAndrey Volk <andywolk@gmail.com>
Sun, 1 Oct 2023 11:01:32 +0000 (14:01 +0300)
committerAndrey Volk <andywolk@gmail.com>
Sun, 1 Oct 2023 11:01:32 +0000 (14:01 +0300)
src/switch_ivr.c

index 7bfe0186f6ac438e98807054cd7b9aff3ea27889..0c0a444b2bb329a13a62a24cbf5a91d10cbf121d 100644 (file)
@@ -2814,7 +2814,7 @@ SWITCH_DECLARE(int) switch_ivr_set_xml_call_stats(switch_xml_t xml, switch_core_
 static int switch_ivr_set_xml_chan_var(switch_xml_t xml, const char *var, const char *val, int off)
 {
        char *data;
-       switch_size_t dlen = strlen(val) * 3 + 1;
+       switch_size_t dlen = val ? strlen(val) * 3 + 1 : 1;
        switch_xml_t variable;
 
        if (!val) val = "";