[sr-dev] git:master:7741ad79: http_client: check if shm is initialized in curl_parse_param()

Daniel-Constantin Mierla miconda at gmail.com
Tue Jun 29 09:29:30 CEST 2021


Module: kamailio
Branch: master
Commit: 7741ad7979d54fb4ee1247760d8d5c3666353a96
URL: https://github.com/kamailio/kamailio/commit/7741ad7979d54fb4ee1247760d8d5c3666353a96

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2021-06-29T07:31:10+02:00

http_client: check if shm is initialized in curl_parse_param()

---

Modified: src/modules/http_client/curlcon.c

---

Diff:  https://github.com/kamailio/kamailio/commit/7741ad7979d54fb4ee1247760d8d5c3666353a96.diff
Patch: https://github.com/kamailio/kamailio/commit/7741ad7979d54fb4ee1247760d8d5c3666353a96.patch

---

diff --git a/src/modules/http_client/curlcon.c b/src/modules/http_client/curlcon.c
index c71df5cd75..7df146493f 100644
--- a/src/modules/http_client/curlcon.c
+++ b/src/modules/http_client/curlcon.c
@@ -32,6 +32,7 @@
 #include "../../core/dprint.h"
 #include "../../core/parser/parse_param.h"
 #include "../../core/usr_avp.h"
+#include "../../core/shm_init.h"
 #include "../../core/cfg_parser.h"
 #include "http_client.h"
 #include "curlcon.h"
@@ -237,6 +238,11 @@ int curl_parse_param(char *val)
 	LM_DBG("modparam httpcon: %s\n", val);
 	LM_DBG(" *** Default httproxy: %s\n", http_proxy.s);
 
+	if(!shm_initialized()) {
+		LM_ERR("shared memory was not initialized\n");
+		return -1;
+	}
+
 	/* parse: name=>http_url*/
 	in.s = val;
 	in.len = strlen(in.s);




More information about the sr-dev mailing list