From: Joe Orton Date: Fri, 17 Jul 2026 12:12:05 +0000 (+0000) Subject: mod_remoteip: fix NULL dereference with PROXY v2 LOCAL command X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=22dc622fc5c1cefcca4a889560ccc08a0592d2a4;p=thirdparty%2Fapache%2Fhttpd.git 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 GitHub: PR #685 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1936258 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/changes-entries/remoteip-proxy-v2-local.txt b/changes-entries/remoteip-proxy-v2-local.txt new file mode 100644 index 0000000000..c2b240b7e3 --- /dev/null +++ b/changes-entries/remoteip-proxy-v2-local.txt @@ -0,0 +1,2 @@ + *) mod_remoteip: Fix crash with PROXY v2 LOCAL command and + RemoteIPProxyProtocol enabled. [Joe Orton] diff --git a/modules/metadata/mod_remoteip.c b/modules/metadata/mod_remoteip.c index 27a42d3cd3..eaa2d7c792 100644 --- a/modules/metadata/mod_remoteip.c +++ b/modules/metadata/mod_remoteip.c @@ -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) {