From 9b7c98cdee88db74d0c274903310eaf36ca59b7e Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Mon, 25 May 2020 05:50:12 +0000 Subject: [PATCH] Fix a NULL pointer dereference * server/scoreboard.c (ap_increment_counts): In certain cases like certain invalid requests r->method might be NULL here. r->method_number defaults to M_GET and hence is M_GET in these cases. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1878092 13f79535-47bb-0310-9956-ffa450edef68 --- server/scoreboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/scoreboard.c b/server/scoreboard.c index a028447ffbd..688f89f75f4 100644 --- a/server/scoreboard.c +++ b/server/scoreboard.c @@ -381,7 +381,7 @@ AP_DECLARE(void) ap_increment_counts(ap_sb_handle_t *sb, request_rec *r) if (pfn_ap_logio_get_last_bytes != NULL) { bytes = pfn_ap_logio_get_last_bytes(r->connection); } - else if (r->method_number == M_GET && r->method[0] == 'H') { + else if (r->method_number == M_GET && r->method && r->method[0] == 'H') { bytes = 0; } else { -- 2.47.3