felipe          Thu May 14 17:23:51 2009 UTC

  Modified files:              
    /php-src/ext/odbc   php_odbc.c 
  Log:
  - Improved fix for #42414
  
http://cvs.php.net/viewvc.cgi/php-src/ext/odbc/php_odbc.c?r1=1.220&r2=1.221&diff_format=u
Index: php-src/ext/odbc/php_odbc.c
diff -u php-src/ext/odbc/php_odbc.c:1.220 php-src/ext/odbc/php_odbc.c:1.221
--- php-src/ext/odbc/php_odbc.c:1.220   Thu May 14 01:25:17 2009
+++ php-src/ext/odbc/php_odbc.c Thu May 14 17:23:51 2009
@@ -20,7 +20,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: php_odbc.c,v 1.220 2009/05/14 01:25:17 felipe Exp $ */
+/* $Id: php_odbc.c,v 1.221 2009/05/14 17:23:51 felipe Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -3026,7 +3026,7 @@
        int cat_len = 0, schema_len = 0, table_len = 0, type_len = 0;
        RETCODE rc;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|ssss", 
&pv_conn, &cat, &cat_len, &schema, &schema_len, 
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s!sss", 
&pv_conn, &cat, &cat_len, &schema, &schema_len, 
                &table, &table_len, &type, &type_len) == FAILURE) {
                return;
        }
@@ -3093,7 +3093,7 @@
        int cat_len = 0, schema_len = 0, table_len = 0, column_len = 0;
        RETCODE rc;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|ssss", 
&pv_conn, &cat, &cat_len, &schema, &schema_len,
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s!sss", 
&pv_conn, &cat, &cat_len, &schema, &schema_len,
                &table, &table_len, &column, &column_len) == FAILURE) {
                return;
        }
@@ -3122,10 +3122,6 @@
                schema = NULL;
        }
 
-       if (cat && cat_len == 0) {
-               cat = NULL;
-       }
-
        rc = SQLColumns(result->stmt, 
                        cat, (SQLSMALLINT) cat_len,
                        schema, (SQLSMALLINT) schema_len,
@@ -3161,7 +3157,7 @@
 PHP_FUNCTION(odbc_columnprivileges)
 {
        zval *pv_conn;
-       odbc_result   *result = NULL;
+       odbc_result *result = NULL;
        odbc_connection *conn;
        char *cat, *schema, *table, *column;
        int cat_len, schema_len, table_len, column_len;
@@ -3188,10 +3184,6 @@
                efree(result);
                RETURN_FALSE;
        }
-       
-       if (cat_len == 0) {
-               cat = NULL;
-       }
 
        rc = SQLColumnPrivileges(result->stmt, 
                        cat, SAFE_SQL_NTS(cat),
@@ -3231,11 +3223,11 @@
        zval *pv_conn;
        odbc_result *result = NULL;
        odbc_connection *conn;
-       char *pcat, *pschema, *ptable, *fcat, *fschema, *ftable;
-       int pcat_len, pschema_len, ptable_len, fcat_len, fschema_len, 
ftable_len;
+       char *pcat = NULL, *pschema, *ptable, *fcat, *fschema, *ftable;
+       int pcat_len = 0, pschema_len, ptable_len, fcat_len, fschema_len, 
ftable_len;
        RETCODE rc;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssssss", 
&pv_conn, &pcat, &pcat_len, &pschema, &pschema_len, 
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs!sssss", 
&pv_conn, &pcat, &pcat_len, &pschema, &pschema_len, 
                &ptable, &ptable_len, &fcat, &fcat_len, &fschema, &fschema_len, 
&ftable, &ftable_len) == FAILURE) {
                return;
        }
@@ -3268,10 +3260,6 @@
                efree(result);
                RETURN_FALSE;
        }
-       
-       if (pcat_len == 0) {
-               pcat = NULL;
-       }
 
        rc = SQLForeignKeys(result->stmt, 
                        pcat, SAFE_SQL_NTS(pcat), 
@@ -3716,10 +3704,10 @@
        odbc_result   *result = NULL;
        odbc_connection *conn;
        char *cat = NULL, *schema = NULL, *table = NULL;
-       int cat_len, schema_len, table_len;
+       int cat_len = 0, schema_len, table_len;
        RETCODE rc;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsss", &pv_conn, 
&cat, &cat_len, &schema, &schema_len, &table, &table_len) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs!ss", &pv_conn, 
&cat, &cat_len, &schema, &schema_len, &table, &table_len) == FAILURE) {
                return;
        }
 
@@ -3739,10 +3727,6 @@
                efree(result);
                RETURN_FALSE;
        }
-       
-       if (cat_len == 0) {
-               cat = NULL;
-       }
 
        rc = SQLTablePrivileges(result->stmt, 
                        cat, SAFE_SQL_NTS(cat), 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to