cvs: php-src(PHP_5_3) /ext/odbc php_odbc.c

From: Date: Thu, 14 May 2009 17:24:42 +0000
Subject: cvs: php-src(PHP_5_3) /ext/odbc php_odbc.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-57827@lists.php.net to get a copy of this message
felipe Thu May 14 17:24:42 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/odbc php_odbc.c Log: - MFH: Improved fix for #42414 http://cvs.php.net/viewvc.cgi/php-src/ext/odbc/php_odbc.c?r1=1.189.2.4.2.7.2.20&r2=1.189.2.4.2.7.2.21&diff_format=u Index: php-src/ext/odbc/php_odbc.c diff -u php-src/ext/odbc/php_odbc.c:1.189.2.4.2.7.2.20 php-src/ext/odbc/php_odbc.c:1.189.2.4.2.7.2.21 --- php-src/ext/odbc/php_odbc.c:1.189.2.4.2.7.2.20 Thu May 14 01:26:39 2009 +++ php-src/ext/odbc/php_odbc.c Thu May 14 17:24:42 2009 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_odbc.c,v 1.189.2.4.2.7.2.20 2009/05/14 01:26:39 felipe Exp $ */ +/* $Id: php_odbc.c,v 1.189.2.4.2.7.2.21 2009/05/14 17:24:42 felipe Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -3031,7 +3031,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; } @@ -3098,7 +3098,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; } @@ -3127,10 +3127,6 @@ schema = NULL; } - if (cat && cat_len == 0) { - cat = NULL; - } - rc = SQLColumns(result->stmt, cat, (SQLSMALLINT) cat_len, schema, (SQLSMALLINT) schema_len, @@ -3168,11 +3164,11 @@ zval *pv_conn; odbc_result *result = NULL; odbc_connection *conn; - char *cat, *schema, *table, *column; - int cat_len, schema_len, table_len, column_len; + char *cat = NULL, *schema, *table, *column; + int cat_len = 0, schema_len, table_len, column_len; RETCODE rc; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssss", &pv_conn, &cat, &cat_len, &schema, &schema_len, + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs!sss", &pv_conn, &cat, &cat_len, &schema, &schema_len, &table, &table_len, &column, &column_len) == FAILURE) { return; } @@ -3193,10 +3189,6 @@ efree(result); RETURN_FALSE; } - - if (cat_len == 0) { - cat = NULL; - } rc = SQLColumnPrivileges(result->stmt, cat, SAFE_SQL_NTS(cat), @@ -3236,11 +3228,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; } @@ -3273,10 +3265,6 @@ efree(result); RETURN_FALSE; } - - if (pcat_len == 0) { - pcat = NULL; - } rc = SQLForeignKeys(result->stmt, pcat, SAFE_SQL_NTS(pcat), @@ -3377,10 +3365,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; } @@ -3400,10 +3388,6 @@ efree(result); RETURN_FALSE; } - - if (cat_len == 0) { - cat = NULL; - } rc = SQLPrimaryKeys(result->stmt, cat, SAFE_SQL_NTS(cat), @@ -3449,7 +3433,7 @@ WRONG_PARAM_COUNT; } - 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, &proc, &proc_len, &col, &col_len) == FAILURE) { return; } @@ -3517,7 +3501,7 @@ WRONG_PARAM_COUNT; } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|sss", &pv_conn, &cat, &cat_len, &schema, &schema_len, &proc, &proc_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s!ss", &pv_conn, &cat, &cat_len, &schema, &schema_len, &proc, &proc_len) == FAILURE) { return; } @@ -3576,11 +3560,11 @@ odbc_result *result = NULL; odbc_connection *conn; char *cat = NULL, *schema = NULL, *name = NULL; - int cat_len, schema_len, name_len; + int cat_len = 0, schema_len, name_len; SQLUSMALLINT type, scope, nullable; RETCODE rc; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlsssll", &pv_conn, &vtype, &cat, &cat_len, &schema, &schema_len, + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rls!ssll", &pv_conn, &vtype, &cat, &cat_len, &schema, &schema_len, &name, &name_len, &vscope, &vnullable) == FAILURE) { return; } @@ -3605,10 +3589,6 @@ efree(result); RETURN_FALSE; } - - if (cat_len == 0) { - cat = NULL; - } rc = SQLSpecialColumns(result->stmt, type, @@ -3649,12 +3629,12 @@ long vunique, vreserved; odbc_result *result = NULL; odbc_connection *conn; - char *cat, *schema, *name; - int cat_len, schema_len, name_len; + char *cat = NULL, *schema, *name; + int cat_len = 0, schema_len, name_len; SQLUSMALLINT unique, reserved; RETCODE rc; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsssll", &pv_conn, &cat, &cat_len, &schema, &schema_len, + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs!ssll", &pv_conn, &cat, &cat_len, &schema, &schema_len, &name, &name_len, &vunique, &vreserved) == FAILURE) { return; } @@ -3678,10 +3658,6 @@ efree(result); RETURN_FALSE; } - - if (cat_len == 0) { - cat = NULL; - } rc = SQLStatistics(result->stmt, cat, SAFE_SQL_NTS(cat), @@ -3722,10 +3698,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; } @@ -3745,10 +3721,6 @@ efree(result); RETURN_FALSE; } - - if (cat_len == 0) { - cat = NULL; - } rc = SQLTablePrivileges(result->stmt, cat, SAFE_SQL_NTS(cat),

« previous php.cvs (#57827) next »