summaryrefslogtreecommitdiffstats
path: root/plugins/check_curl.c
diff options
context:
space:
mode:
authorSven Nierlein <sven@nierlein.de>2021-04-07 08:30:31 (GMT)
committerGitHub <noreply@github.com>2021-04-07 08:30:31 (GMT)
commit2e5b38cc832c3e818b43515636e04b7218e6f995 (patch)
tree158744b31a8d086396ca1780edbe5f2924d89f24 /plugins/check_curl.c
parentb820725ee18608de9c0c157f83ef160659b35207 (diff)
parent5cfc93d995cfd5cc7d1a469f3c1276c4884da2a2 (diff)
downloadmonitoring-plugins-2e5b38cc832c3e818b43515636e04b7218e6f995.tar.gz
Merge pull request #1666 from sni/check_curl_fix_header_parser
fix check_curl crash if http header contains leading spaces
Diffstat (limited to 'plugins/check_curl.c')
-rw-r--r--plugins/check_curl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/check_curl.c b/plugins/check_curl.c
index 8f274c2..9f1eafa 100644
--- a/plugins/check_curl.c
+++ b/plugins/check_curl.c
@@ -2060,7 +2060,7 @@ get_header_value (const struct phr_header* headers, const size_t nof_headers, co
2060{ 2060{
2061 int i; 2061 int i;
2062 for( i = 0; i < nof_headers; i++ ) { 2062 for( i = 0; i < nof_headers; i++ ) {
2063 if( strncasecmp( header, headers[i].name, max( headers[i].name_len, 4 ) ) == 0 ) { 2063 if(headers[i].name != NULL && strncasecmp( header, headers[i].name, max( headers[i].name_len, 4 ) ) == 0 ) {
2064 return strndup( headers[i].value, headers[i].value_len ); 2064 return strndup( headers[i].value, headers[i].value_len );
2065 } 2065 }
2066 } 2066 }