]> granicus.if.org Git - php/commitdiff
add some safe casts
authorAndrey Hristov <andrey@php.net>
Tue, 5 Oct 2010 11:08:21 +0000 (11:08 +0000)
committerAndrey Hristov <andrey@php.net>
Tue, 5 Oct 2010 11:08:21 +0000 (11:08 +0000)
ext/mysqlnd/mysqlnd_wireprotocol.c

index 992f9cbdf212666be586d3fa594cd4e52d68ae43..b39b0fb0346541e5dc2a00d8377437016c02b8c0 100644 (file)
@@ -1392,7 +1392,7 @@ php_mysqlnd_rowp_read_text_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval
 #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 @@ php_mysqlnd_rowp_read_text_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval
                                        {
                                                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;