felipe                                   Wed, 25 Aug 2010 22:03:03 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=302783

Log:
- Fixed bug #52699 (PDO bindValue writes long int 32bit enum)

Bug: http://bugs.php.net/52699 (Open) PDO bindValue writes long int 32bit enum.
      
Changed paths:
    U   php/php-src/branches/PHP_5_3/NEWS
    U   php/php-src/branches/PHP_5_3/ext/pdo/pdo_stmt.c
    U   php/php-src/trunk/ext/pdo/pdo_stmt.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===================================================================
--- php/php-src/branches/PHP_5_3/NEWS   2010-08-25 19:54:18 UTC (rev 302782)
+++ php/php-src/branches/PHP_5_3/NEWS   2010-08-25 22:03:03 UTC (rev 302783)
@@ -15,6 +15,8 @@
 - Changed the $context parameter on copy() to actually have an effect. (Kalle)
 - Fixed possible crash in mssql_fetch_batch(). (Kalle)

+- Fixed bug #52699 (PDO bindValue writes long int 32bit enum).
+  (rein at basefarm dot no)
 - Fixed bug #52681 (mb_send_mail() appends an extra MIME-Version header).
   (Adam)
 - Fixed bug #52674 (FPM Status page returns inconsistent Content-Type headers).

Modified: php/php-src/branches/PHP_5_3/ext/pdo/pdo_stmt.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/pdo/pdo_stmt.c     2010-08-25 19:54:18 UTC 
(rev 302782)
+++ php/php-src/branches/PHP_5_3/ext/pdo/pdo_stmt.c     2010-08-25 22:03:03 UTC 
(rev 302783)
@@ -1624,18 +1624,20 @@
 static PHP_METHOD(PDOStatement, bindValue)
 {
        struct pdo_bound_param_data param = {0};
+       long param_type = PDO_PARAM_STR;
        PHP_STMT_GET_OBJ;

        param.paramno = -1;
-       param.param_type = PDO_PARAM_STR;

        if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, 
ZEND_NUM_ARGS() TSRMLS_CC,
-                       "lz/|l", &param.paramno, &param.parameter, 
&param.param_type)) {
+                       "lz/|l", &param.paramno, &param.parameter, 
&param_type)) {
                if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, 
"sz/|l", &param.name,
-                               &param.namelen, &param.parameter, 
&param.param_type)) {
+                               &param.namelen, &param.parameter, &param_type)) 
{
                        RETURN_FALSE;
                }
        }
+
+       param.param_type = (int) param_type;

        if (param.paramno > 0) {
                --param.paramno; /* make it zero-based internally */

Modified: php/php-src/trunk/ext/pdo/pdo_stmt.c
===================================================================
--- php/php-src/trunk/ext/pdo/pdo_stmt.c        2010-08-25 19:54:18 UTC (rev 
302782)
+++ php/php-src/trunk/ext/pdo/pdo_stmt.c        2010-08-25 22:03:03 UTC (rev 
302783)
@@ -1624,18 +1624,20 @@
 static PHP_METHOD(PDOStatement, bindValue)
 {
        struct pdo_bound_param_data param = {0};
+       long param_type = PDO_PARAM_STR;
        PHP_STMT_GET_OBJ;

        param.paramno = -1;
-       param.param_type = PDO_PARAM_STR;

        if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, 
ZEND_NUM_ARGS() TSRMLS_CC,
-                       "lz/|l", &param.paramno, &param.parameter, 
&param.param_type)) {
+                       "lz/|l", &param.paramno, &param.parameter, 
&param_type)) {
                if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, 
"sz/|l", &param.name,
-                               &param.namelen, &param.parameter, 
&param.param_type)) {
+                               &param.namelen, &param.parameter, &param_type)) 
{
                        RETURN_FALSE;
                }
        }
+
+       param.param_type = (int) param_type;

        if (param.paramno > 0) {
                --param.paramno; /* make it zero-based internally */

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

Reply via email to