summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2025-11-27 14:43:32 +0100
committerGitHub <noreply@github.com>2025-11-27 14:43:32 +0100
commit6c231f0dd8e6e07f58de155b0a879532583f4bf0 (patch)
tree0ac24f7bd2bc09f3d81583a2f7ebd3d67e2bdf34
parenta2ccc814873677f4e50fe63b92c171e992a0c903 (diff)
parent2917b8735f1d56211eac0ad1bf7a051a842abd76 (diff)
downloadmonitoring-plugins-6c231f0dd8e6e07f58de155b0a879532583f4bf0.tar.gz
Merge pull request #2185 from RincewindsHat/fix/curl_segfault
check_curl: abort redir if location is not found
-rw-r--r--plugins/check_curl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/check_curl.c b/plugins/check_curl.c
index a20ce749..ba856a11 100644
--- a/plugins/check_curl.c
+++ b/plugins/check_curl.c
@@ -672,6 +672,11 @@ redir_wrapper redir(curlhelp_write_curlbuf *header_buf, const check_curl_config
672 672
673 char *location = get_header_value(headers, nof_headers, "location"); 673 char *location = get_header_value(headers, nof_headers, "location");
674 674
675 if (location == NULL) {
676 // location header not found
677 die(STATE_UNKNOWN, "HTTP UNKNOWN - could not find \"location\" header\n");
678 }
679
675 if (verbose >= 2) { 680 if (verbose >= 2) {
676 printf(_("* Seen redirect location %s\n"), location); 681 printf(_("* Seen redirect location %s\n"), location);
677 } 682 }