Wrong decoding causes crash #1350

Wrong decoding in MySQL protocol for field bigger than 16MB causes crash.
The only code path affected by this seems to be reading parameters from
prepared statements.
pull/1867/head
René Cannaò 7 years ago
parent cacbe7c901
commit c1c0617995

@ -42,9 +42,6 @@
// copy 4 bytes
#define CPY4(x) *((uint32_t *)x)
// copy 8 bytes
#define CPY8(x) *((uint64_t *)x)
// (un)set blocking mode on a file descriptor
#define ioctl_FIONBIO(fd, mode) \
{ \

@ -215,6 +215,12 @@ unsigned int CPY3(unsigned char *ptr) {
return buf.i;
}
uint64_t CPY8(unsigned char *ptr) {
uint64_t buf;
memcpy(&buf,ptr,sizeof(uint64_t));
return buf;
}
// see http://dev.mysql.com/doc/internals/en/integer.html#packet-Protocol::LengthEncodedInteger
/* arguments to pass:
* pointer to the field

Loading…
Cancel
Save