From e8f6102685a2afd80c7b7f464778f00d2839f8be Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Sun, 1 Oct 2023 14:01:32 +0300 Subject: [PATCH] [Core] Coverity: 1060958 Dereference before null check --- src/switch_ivr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_ivr.c b/src/switch_ivr.c index 7bfe0186f6..0c0a444b2b 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -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 = "";