diff options
| author | Andrey Hristov <andrey@php.net> | 2016-12-12 21:11:02 +0200 |
|---|---|---|
| committer | Andrey Hristov <andrey@php.net> | 2016-12-12 21:11:02 +0200 |
| commit | e15c418c4c765d3a0c65a5ff15dcf37b1e556a66 (patch) | |
| tree | 4fe2cc86cff6ab792a5dd29d2fdda87b5fd88469 /ext/mysqlnd/mysqlnd_ps_codec.c | |
| parent | 7a8774ade4383cd1c98d46e7e64f73f869a110e2 (diff) | |
| download | php-git-e15c418c4c765d3a0c65a5ff15dcf37b1e556a66.tar.gz | |
Fix off by 1 problem.
The problem was manifestated only with BIT columns and only when more than
one row was fetched. The problem was coming from the fact that in pre-7.0
times mysqlnd was using a no-copy optimization. This optimization kept the
strings (and also the BIT mask equivalents as strings) in the packet and the
zval referred to them. 7.0+ zvals cannot use no-copy and always copy. Because
of this the allocated memory for the packet was reduced by 1 by the person who
ported the driver, but the starting address of the bit area wasn't reduced.
Because of this the bit_area started at wrong address and the length decoded
wrong.
Diffstat (limited to 'ext/mysqlnd/mysqlnd_ps_codec.c')
| -rw-r--r-- | ext/mysqlnd/mysqlnd_ps_codec.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/mysqlnd/mysqlnd_ps_codec.c b/ext/mysqlnd/mysqlnd_ps_codec.c index e0b6c5630f..da2436310e 100644 --- a/ext/mysqlnd/mysqlnd_ps_codec.c +++ b/ext/mysqlnd/mysqlnd_ps_codec.c @@ -88,6 +88,7 @@ ps_fetch_from_1_to_8_bytes(zval * zv, const MYSQLND_FIELD * const field, unsigne } else { DBG_INF("stringify"); tmp_len = sprintf((char *)&tmp, MYSQLND_LLU_SPEC, uval); + DBG_INF_FMT("value=%s", tmp); } } } else { |
