summaryrefslogtreecommitdiffstats
path: root/plugins/check_http.c
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2023-02-06 16:23:55 (GMT)
committerAndreas Baumann <mail@andreasbaumann.cc>2023-02-06 16:23:55 (GMT)
commit9734c439cba0a02b087e50789e94ec9b07754608 (patch)
treef8d97e63519e0da6c73e90a45ccf7e3ca37a488c /plugins/check_http.c
parent53f07a468db98247dc4012de0ee678f29cc2bfec (diff)
parente0dfb0622d19a4b4340dab9a315cb4b649f6f1e4 (diff)
downloadmonitoring-plugins-9734c439cba0a02b087e50789e94ec9b07754608.tar.gz
Merge branch 'master' into curlfixes
Diffstat (limited to 'plugins/check_http.c')
-rw-r--r--plugins/check_http.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/check_http.c b/plugins/check_http.c
index 5fa310f..8dda046 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -1462,7 +1462,13 @@ char *unchunk_content(const char *content) {
1462 memcpy(result + (overall_size - size_of_chunk), start_of_chunk, size_of_chunk); 1462 memcpy(result + (overall_size - size_of_chunk), start_of_chunk, size_of_chunk);
1463 } 1463 }
1464 1464
1465 result[overall_size] = '\0'; 1465 if (overall_size == 0 && result == NULL) {
1466 // We might just have received the end chunk without previous content, so result is never allocated
1467 result = calloc(1, sizeof(char));
1468 // No error handling here, we can only return NULL anyway
1469 } else {
1470 result[overall_size] = '\0';
1471 }
1466 return result; 1472 return result;
1467} 1473}
1468 1474