]> granicus.if.org Git - php/commitdiff
- MFH: Fixed bug #47048 (Segfault with new pg_meta_data)
authorFelipe Pena <felipe@php.net>
Sun, 18 Jan 2009 23:49:31 +0000 (23:49 +0000)
committerFelipe Pena <felipe@php.net>
Sun, 18 Jan 2009 23:49:31 +0000 (23:49 +0000)
ext/pgsql/pgsql.c

index a4a5b0d2a9d930600f248c2abf08a382b6a64514..5b6e3c881ad4bb51a5060fc9c64fef828cce218e 100644 (file)
@@ -4831,7 +4831,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";