]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_remoteip: fix NULL dereference with PROXY v2 LOCAL command
authorJoe Orton <jorton@apache.org>
Fri, 17 Jul 2026 12:12:05 +0000 (12:12 +0000)
committerJoe Orton <jorton@apache.org>
Fri, 17 Jul 2026 12:12:05 +0000 (12:12 +0000)
* 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 <noreply@anthropic.com>
GitHub: PR #685

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1936258 13f79535-47bb-0310-9956-ffa450edef68

changes-entries/remoteip-proxy-v2-local.txt [new file with mode: 0644]
modules/metadata/mod_remoteip.c

diff --git a/changes-entries/remoteip-proxy-v2-local.txt b/changes-entries/remoteip-proxy-v2-local.txt
new file mode 100644 (file)
index 0000000..c2b240b
--- /dev/null
@@ -0,0 +1,2 @@
+  *) mod_remoteip: Fix crash with PROXY v2 LOCAL command and
+     RemoteIPProxyProtocol enabled.  [Joe Orton]
index 27a42d3cd37cf6e8ef64102c0d5265eafd9cf9dd..eaa2d7c7926750995c1df9ab6c69fb72763df14b 100644 (file)
@@ -950,6 +950,8 @@ static remoteip_parse_status_t remoteip_process_v2_header(conn_rec *c,
     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) {