From c1fbb1801229f9afd13abfa96ebf5f20acb3a033 Mon Sep 17 00:00:00 2001 From: Andre Lorbach Date: Tue, 23 Jul 2013 12:33:33 +0200 Subject: Fixed bugid #464 in elasticsearch output module Added some libcurl options in checkConn to disable the bodyport of the request within this functions. Otherwise libcurl could have created a sigsegv when curl_easy_perform() was called. --- plugins/omelasticsearch/omelasticsearch.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'plugins/omelasticsearch') diff --git a/plugins/omelasticsearch/omelasticsearch.c b/plugins/omelasticsearch/omelasticsearch.c index cb96fb6b..5c53ba19 100644 --- a/plugins/omelasticsearch/omelasticsearch.c +++ b/plugins/omelasticsearch/omelasticsearch.c @@ -224,6 +224,12 @@ checkConn(instanceData *pData) DBGPRINTF("omelasticsearch: checkConn() curl_easy_init() failed\n"); ABORT_FINALIZE(RS_RET_SUSPENDED); } + /* Bodypart of request not needed, so set curl opt to nobody and httpget, otherwise lib-curl could sigsegv */ + curl_easy_setopt(curl, CURLOPT_HTTPGET, TRUE); + curl_easy_setopt(curl, CURLOPT_NOBODY, TRUE); + /* Only enable for debugging + curl_easy_setopt(curl, CURLOPT_VERBOSE, TRUE); */ + cstr = es_str2cstr(url, NULL); curl_easy_setopt(curl, CURLOPT_URL, cstr); free(cstr); -- cgit v1.2.3