]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[libesl] Coverity 1024285 Dereference before null check
authorAndrey Volk <andywolk@gmail.com>
Fri, 31 Jan 2025 14:48:28 +0000 (17:48 +0300)
committerAndrey Volk <andywolk@gmail.com>
Mon, 3 Feb 2025 23:18:47 +0000 (02:18 +0300)
libs/esl/src/esl.c

index 893a068e8c1e22eca0abf4b5234ddc7318a66ba0..9304bc5749aa3a67de100491bfbc27a428b6c1eb 100644 (file)
@@ -1299,14 +1299,12 @@ ESL_DECLARE(esl_status_t) esl_recv_event(esl_handle_t *handle, int check_q, esl_
                                                *e++ = '\0';
                                                while(*e == '\n' || *e == '\r') e++;
                                                
-                                               if (hval) {
-                                                       esl_url_decode(hval);
-                                                       esl_log(ESL_LOG_DEBUG, "RECV HEADER [%s] = [%s]\n", hname, hval);
-                                                       if (!strncmp(hval, "ARRAY::", 7)) {
-                                                               esl_event_add_array(revent, hname, hval);
-                                                       } else {
-                                                               esl_event_add_header_string(revent, ESL_STACK_BOTTOM, hname, hval);
-                                                       }
+                                               esl_url_decode(hval);
+                                               esl_log(ESL_LOG_DEBUG, "RECV HEADER [%s] = [%s]\n", hname, hval);
+                                               if (!strncmp(hval, "ARRAY::", 7)) {
+                                                       esl_event_add_array(revent, hname, hval);
+                                               } else {
+                                                       esl_event_add_header_string(revent, ESL_STACK_BOTTOM, hname, hval);
                                                }
                                                
                                                p = e;