php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch 0001-php_check_open_basedir_ex-check-that-path-isn-t-NULL.patch for Reproducible crash Bug #69054

Patch version 2015-02-14 21:53 UTC

Return to Bug #69054 | Download this patch
Patch Revisions:

Developer: dx@dxzone.com.ar

From 069db417f20532bbe0b3dc8fb0795cb7c26e07dc Mon Sep 17 00:00:00 2001
From: dequis <dx@dxzone.com.ar>
Date: Sat, 14 Feb 2015 18:25:31 -0300
Subject: [PATCH] php_check_open_basedir_ex: check that path isn't NULL

---
 main/fopen_wrappers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c
index 9414ebd..a65ef4a 100644
--- a/main/fopen_wrappers.c
+++ b/main/fopen_wrappers.c
@@ -294,7 +294,7 @@ PHPAPI int php_check_open_basedir(const char *path)
 PHPAPI int php_check_open_basedir_ex(const char *path, int warn)
 {
 	/* Only check when open_basedir is available */
-	if (PG(open_basedir) && *PG(open_basedir)) {
+	if (path && PG(open_basedir) && *PG(open_basedir)) {
 		char *pathbuf;
 		char *ptr;
 		char *end;
-- 
2.0.0+fc2

 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Feb 26 14:01:28 2020 UTC