# [PATCH] apache2handler apache_setenv fix

- Thread: https://externals.io/message/5333
- Original archive: https://news-web.php.net/php.internals/5333
- Started by Joe Orton on 2003-11-10T12:27:20+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #5333 — Joe Orton — 2003-11-10T12:27:20+00:00

URL: https://externals.io/message/5333#5333

'r' is not initialized unless walk_to_top is set:

Index: sapi/apache2handler/php_functions.c
===================================================================
RCS file: /repository/php-src/sapi/apache2handler/php_functions.c,v
retrieving revision 1.1.2.9
diff -u -r1.1.2.9 php_functions.c
--- sapi/apache2handler/php_functions.c	10 Jul 2003 22:45:34 -0000	1.1.2.9
+++ sapi/apache2handler/php_functions.c	10 Nov 2003 12:26:15 -0000
@@ -259,8 +259,8 @@
 
 	ctx = SG(server_context);
 
+	r = ctx->r;
 	if (arg_count == 3 && Z_STRVAL_PP(walk_to_top)) {
-        r = ctx->r;
 		while(r->prev) {
 			r = r->prev;
 		}
