-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fixed bug #66124 #532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed bug #66124 #532
Conversation
@@ -585,7 +585,8 @@ void _mysqlnd_init_ps_fetch_subsystem() | |||
*/ | |||
if (Z_TYPE_P(stmt->param_bind[i].zv) != IS_LONG) { | |||
zval *tmp_data = (copies && copies[i])? copies[i]: stmt->param_bind[i].zv; | |||
convert_to_double_ex(&tmp_data); | |||
//convert_to_double_ex(&tmp_data); | |||
convert_to_long_ex(&tmp_data); | |||
if (Z_DVAL_P(tmp_data) > LONG_MAX || Z_DVAL_P(tmp_data) < LONG_MIN) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accessing DVAL after casting to long? That can't be right...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right nikic, I put my focus on my problem but forgetting to get everything right, sorry for that.
but the convert to double issue really caused my problem, maybe I should get another temporary zval to make old code working as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Die Zustellung an folgende Empfänger oder Gruppen verzögert sich:
p.bandow@justepic.infomailto:p.bandow@justepic.info
Betreff: Re: [php-src] Fixed bug #66124 (#532)
Diese Nachricht wurde noch nicht zugestellt. Es wird weiterhin versucht, die Nachricht zuzustellen.
Der Server wird noch 2 Tage, 22 Stunden und 58 Minuten versuchen, die Nachricht zuzustellen. Sie erhalten eine Benachrichtigung, falls die Nachricht bis dahin nicht übermittelt werden konnte.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Die Zustellung an folgende Empfänger oder Gruppen verzögert sich:
p.bandow@justepic.infomailto:p.bandow@justepic.info
Betreff: Re: [php-src] Fixed bug #66124 (#532)
Diese Nachricht wurde noch nicht zugestellt. Es wird weiterhin versucht, die Nachricht zuzustellen.
Der Server wird noch 2 Tage, 22 Stunden und 57 Minuten versuchen, die Nachricht zuzustellen. Sie erhalten eine Benachrichtigung, falls die Nachricht bis dahin nicht übermittelt werden konnte.
@nikic would you please review the latest commit? |
if (Z_DVAL_P(tmp_data) > LONG_MAX || Z_DVAL_P(tmp_data) < LONG_MIN) { | ||
stmt->send_types_to_server = resend_types_next_time = 1; | ||
} | ||
zval_dtor(tmp_data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You created the zval with MAKE_STD_ZVAL
but destroy with zval_dtor
, that will leak the container. You're probably looking for something like this:
zval tmp_data;
ZVAL_ZVAL(&tmp_data, (copies && copies[i]) ? copies[i]: stmt->param_bind[i].zv, 1, 0);
convert_to_double(&tmp_data);
// ...
zval_dtor(&tmp_data);
That's the semi-standard approach to performing a cast without touching the zval. The ZVAL_ZVAL is the same as ZVAL_COPY_VALUE+zval_copy_ctor.
https://bugs.php.net/bug.php?id=66124