From 57a2fd2b3464bf2e1ae8a04a12196aed1bac279e Mon Sep 17 00:00:00 2001
From: Eric Covener <covener@apache.org>
Date: Mon, 1 Dec 2025 12:05:19 +0000
Subject: [PATCH] Merge r1930161 from trunk:

don't pass args for SSI request



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1930165 13f79535-47bb-0310-9956-ffa450edef68
---
 modules/generators/mod_cgid.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Index: apache2-2.4.29/modules/generators/mod_cgid.c
===================================================================
--- apache2-2.4.29.orig/modules/generators/mod_cgid.c	2026-05-20 18:25:53.322993178 +0100
+++ apache2-2.4.29/modules/generators/mod_cgid.c	2026-05-20 18:25:53.307993147 +0100
@@ -236,7 +236,7 @@
     char *w;
     int idx = 0;
 
-    if (!(*args) || ap_strchr_c(args, '=')) {
+    if (!args || !(*args) || ap_strchr_c(args, '=')) {
         numwords = 0;
     }
     else {
@@ -802,7 +802,10 @@
         else {
             apr_pool_userdata_set(r, ERRFN_USERDATA_KEY, apr_pool_cleanup_null, ptrans);
 
-            argv = (const char * const *)create_argv(r->pool, NULL, NULL, NULL, argv0, r->args);
+            /* Do not pass args in case of SSI requests */
+            argv = (const char * const *)create_argv(r->pool, NULL, NULL, NULL,
+                                                     argv0,
+                                                     cgid_req.req_type == SSI_REQ ? NULL : r->args);
 
            /* We want to close sd2 for the new CGI process too.
             * If it is left open it'll make ap_pass_brigade() block
