From 9c1837e8da53d3453b58f52a9a20b7662d9bdfce Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Sun, 18 Jan 2009 23:51:15 +0000 Subject: [PATCH] - MFH: Fixed bug #47048 (Segfault with new pg_meta_data) --- NEWS | 1 + ext/pgsql/pgsql.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 1106032c51..98c21db183 100644 --- a/NEWS +++ b/NEWS @@ -20,6 +20,7 @@ PHP NEWS - Fixed bug #47104 (Linking shared extensions fails with icc). (Jani) - Fixed bug #47109 (Memory leak on $a->{"a"."b"} when $a is not an object). (Etienne, Dmitry) +- Fixed bug #47048 (Segfault with new pg_meta_data). (Felipe) - Fixed bug #47042 (PHP cgi sapi is removing SCRIPT_FILENAME for non apache). (Sriram Natarajan) - Fixed bug #47037 (No error when using fopen with empty string). diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 511d9a9c4a..7e71fc5c8e 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -4425,7 +4425,7 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); - if (!*tmp_name2) { + if (!tmp_name2 || !*tmp_name2) { /* Default schema */ tmp_name2 = tmp_name; tmp_name = "public"; -- 2.50.1