andrey                                   Tue, 05 Oct 2010 11:08:21 +0000

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

Log:
add some safe casts

Changed paths:
    U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_wireprotocol.c
    U   php/php-src/trunk/ext/mysqlnd/mysqlnd_wireprotocol.c

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_wireprotocol.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_wireprotocol.c     
2010-10-05 11:02:10 UTC (rev 304080)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_wireprotocol.c     
2010-10-05 11:08:21 UTC (rev 304081)
@@ -1392,7 +1392,7 @@
 #else
                                                _atoi64((char *) p);
 #endif
-                                       ZVAL_LONG(*current_field, v);
+                                       ZVAL_LONG(*current_field, (long) v); /* 
the cast is safe */
                                } else {
                                        uint64_t v =
 #ifndef PHP_WIN32
@@ -1414,7 +1414,7 @@
                                        {
                                                ZVAL_STRINGL(*current_field, 
(char *)p, len, 0);
                                        } else {
-                                               ZVAL_LONG(*current_field, 
(int64_t)v);
+                                               ZVAL_LONG(*current_field, 
(long) v); /* the cast is safe */
                                        }
                                }
                                *(p + len) = save;

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_wireprotocol.c
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_wireprotocol.c        2010-10-05 
11:02:10 UTC (rev 304080)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_wireprotocol.c        2010-10-05 
11:08:21 UTC (rev 304081)
@@ -1392,7 +1392,7 @@
 #else
                                                _atoi64((char *) p);
 #endif
-                                       ZVAL_LONG(*current_field, v);
+                                       ZVAL_LONG(*current_field, (long) v); /* 
the cast is safe */
                                } else {
                                        uint64_t v =
 #ifndef PHP_WIN32
@@ -1414,7 +1414,7 @@
                                        {
                                                ZVAL_STRINGL(*current_field, 
(char *)p, len, 0);
                                        } else {
-                                               ZVAL_LONG(*current_field, 
(int64_t)v);
+                                               ZVAL_LONG(*current_field, 
(long) v); /* the cast is safe */
                                        }
                                }
                                *(p + len) = save;

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

Reply via email to