Blame SOURCES/php-5.5.21-CVE-2015-1352.patch

8bac60
From 968fbc6acf0bc27be17c0209be7f966e89a55943 Mon Sep 17 00:00:00 2001
8bac60
From: Stanislav Malyshev <stas@php.net>
8bac60
Date: Sun, 22 Mar 2015 18:20:59 -0700
8bac60
Subject: [PATCH] Bacport fix bug #68741 - Null pointer dereference
8bac60
8bac60
---
8bac60
 NEWS              | 3 +++
8bac60
 ext/pgsql/pgsql.c | 3 +++
8bac60
 2 files changed, 6 insertions(+)
8bac60
8bac60
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
8bac60
index 16ce7bf..eb55777 100644
8bac60
--- a/ext/pgsql/pgsql.c
8bac60
+++ b/ext/pgsql/pgsql.c
8bac60
@@ -6118,6 +6118,9 @@ static inline void build_tablename(smart_str *querystr, PGconn *pg_link, const c
8bac60
 	/* schame.table should be "schame"."table" */
8bac60
 	table_copy = estrdup(table);
8bac60
 	token = php_strtok_r(table_copy, ".", &tmp);
8bac60
+	if (token == NULL) {
8bac60
+		token = table;
8bac60
+	}
8bac60
 	len = strlen(token);
8bac60
 	if (_php_pgsql_detect_identifier_escape(token, len) == SUCCESS) {
8bac60
 		smart_str_appendl(querystr, token, len);
8bac60
-- 
8bac60
2.1.4
8bac60