]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Fix a NULL pointer dereference
authorRuediger Pluem <rpluem@apache.org>
Mon, 25 May 2020 05:50:12 +0000 (05:50 +0000)
committerRuediger Pluem <rpluem@apache.org>
Mon, 25 May 2020 05:50:12 +0000 (05:50 +0000)
* 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

index a028447ffbd0f31ba3f72da53c390d064d627006..688f89f75f4dfd0a76737af00aacce806d3a1a66 100644 (file)
@@ -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 {