Module: kamailio
Branch: 5.5
Commit: b27dc141ccddfb3e0f77399ead8b2b158942de69
URL:
https://github.com/kamailio/kamailio/commit/b27dc141ccddfb3e0f77399ead8b2b1…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-06-29T14:41:38+02:00
http_client: check if shm is initialized in curl_parse_param()
(cherry picked from commit 7741ad7979d54fb4ee1247760d8d5c3666353a96)
---
Modified: src/modules/http_client/curlcon.c
---
Diff:
https://github.com/kamailio/kamailio/commit/b27dc141ccddfb3e0f77399ead8b2b1…
Patch:
https://github.com/kamailio/kamailio/commit/b27dc141ccddfb3e0f77399ead8b2b1…
---
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);