Anatol,
On 4.02.2014 16:39, Anatol Belski wrote:
Hi Andrey,
On Tue, February 4, 2014 14:19, Andrey Hristov wrote:
On 1.02.2014 14:30, Anatol Belski wrote:
I saw 2 problems with the patch, in mysqlnd. After 2 instances I stopped
reading but a parameter of type uint is being declared as php_int_t, a flag
variable.
I appreciate you could take a look at this. Could you point to the exact
place where you see an issue? With the replacement of uint there are
multiple reasons (and we was talking about it while being on the
discussion about the mysqli_poll), two main of those
- php_size_t should be used for string lengths
- even flags coming from userland may cause overflow in 64 bit mode
So uint to php_uint_t might be because of that, depending on what you're
talking about.
Thanks
Anatol
-typedef enum_func_status (*func_mysqlnd_conn_data__tx_commit_or_rollback)(MYSQLND_CONN_DATA * conn, const zend_bool commit, const unsigned int flags, const char * const name TSRMLS_DC);
+typedef enum_func_status (*func_mysqlnd_conn_data__tx_commit_or_rollback)(MYSQLND_CONN_DATA * conn, const zend_bool commit, const php_int_t flags, const char * const name TSRMLS_DC);
The API needs unsigned integer, not signed one. mysql, mysqli and pdo should take care when they get signed integers and pass them appropriately.
Here is more:
- unsigned int char_minlen;
- unsigned int char_maxlen;
+ php_size_t char_minlen;
+ php_size_t char_maxlen;
even unsigned int is too much for this data but still, going size_t just is completely unnecessary, as the value will be between 1 and 4. However, as you don't know the inner workings it is excuseable. Still my standpoint that we inflate memory usage where it is not necessary at all.
- Check bug #52891 : Wrong data inserted with mysqli/mysqlnd when using bind_param, value > LONG_MAX
+ Check bug #52891 : Wrong data inserted with mysqli/mysqlnd when using bind_param, value > PHP_INT_MAX
Here this is a line in a comment. The bug has specific title and it hasn't changed, however the constant mentioned is changed. A bit annoying.
There might be more, I gave a glance look at it. I'm curious to see how much memory real scripts will use with the branch.
Best,
Andrey