]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1878092 from trunk:
authorYann Ylavic <ylavic@apache.org>
Tue, 7 Sep 2021 16:05:31 +0000 (16:05 +0000)
committerYann Ylavic <ylavic@apache.org>
Tue, 7 Sep 2021 16:05:31 +0000 (16:05 +0000)
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.

Submitted by: rpluem
Reviewed by: covener, ylavic, jfclere

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1893051 13f79535-47bb-0310-9956-ffa450edef68

server/scoreboard.c

index b40b45df5900be62b0d48c3fe2330e0d51ce18f1..12dd56abeade83a4c1545df9f9189eb351b697ec 100644 (file)
@@ -388,7 +388,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 {