From: Ruediger Pluem Date: Mon, 25 May 2020 05:50:12 +0000 (+0000) Subject: Fix a NULL pointer dereference X-Git-Tag: 2.5.0-alpha2-ci-test-only~1420 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b7c98cdee88db74d0c274903310eaf36ca59b7e;p=thirdparty%2Fapache%2Fhttpd.git 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 --- 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 {