svn commit: r1936258 - in httpd/httpd/trunk: changes-entries modules/metadata

[email protected] Fri, 17 Jul 2026 12:12:05 -0000
Newsgroups gmane.comp.apache.cvs
Message-ID <178429032572.3835683.10916031768342933020@svn03-he-fi>
Author: jorton
Date: Fri Jul 17 12:12:05 2026
New Revision: 1936258

Log:
mod_remoteip: fix NULL dereference with PROXY v2 LOCAL command

* modules/metadata/mod_remoteip.c (remoteip_process_v2_header): Set
  conn_conf->client_addr and client_ip for the LOCAL case, matching
  the v1 UNKNOWN path.

Assisted-by: Claude Sonnet 4.6 <[email protected]>
GitHub: PR #685

Added:
   httpd/httpd/trunk/changes-entries/remoteip-proxy-v2-local.txt
Modified:
   httpd/httpd/trunk/modules/metadata/mod_remoteip.c

Added: httpd/httpd/trunk/changes-entries/remoteip-proxy-v2-local.txt
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ httpd/httpd/trunk/changes-entries/remoteip-proxy-v2-local.txt	Fri Jul 17 12:12:05 2026	(r1936258)
@@ -0,0 +1,2 @@
+  *) mod_remoteip: Fix crash with PROXY v2 LOCAL command and
+     RemoteIPProxyProtocol enabled.  [Joe Orton]

Modified: httpd/httpd/trunk/modules/metadata/mod_remoteip.c
==============================================================================
--- httpd/httpd/trunk/modules/metadata/mod_remoteip.c	Fri Jul 17 12:07:47 2026	(r1936257)
+++ httpd/httpd/trunk/modules/metadata/mod_remoteip.c	Fri Jul 17 12:12:05 2026	(r1936258)
@@ -950,6 +950,8 @@ static remoteip_parse_status_t remoteip_
     switch (hdr->v2.ver_cmd & 0xF) {
         case 0x00: /* LOCAL command */
             /* keep local connection address for LOCAL */
+            conn_conf->client_addr = c->client_addr;
+            conn_conf->client_ip = c->client_ip;
             return HDR_DONE;
         case 0x01: /* PROXY command */
             switch (hdr->v2.fam) {