diff options
author | Lorenz <12514511+RincewindsHat@users.noreply.github.com> | 2023-02-06 18:51:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-06 18:51:40 +0100 |
commit | 5a50b260ee94df89f2e328affa93983bb0caff57 (patch) | |
tree | 2a660ceb8a8736058142523a60b11edf0444d690 /plugins/check_http.c | |
parent | dca0927b459ca7f1260d1d359865d3821297d81a (diff) | |
parent | e0dfb0622d19a4b4340dab9a315cb4b649f6f1e4 (diff) | |
download | monitoring-plugins-5a50b26.tar.gz |
Merge branch 'master' into gnulib_update_2023
Diffstat (limited to 'plugins/check_http.c')
-rw-r--r-- | plugins/check_http.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/check_http.c b/plugins/check_http.c index 5fa310f5..8dda046f 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 | ||