[MXS-137] cannot get sql for queries with length >= 0x80 Created: 2015-05-12 Updated: 2015-05-13 Resolved: 2015-05-13 |
|
| Status: | Closed |
| Project: | MariaDB MaxScale |
| Component/s: | Core |
| Affects Version/s: | None |
| Fix Version/s: | 1.2.0 |
| Type: | Bug | Priority: | Major |
| Reporter: | Yuval Hager | Assignee: | markus makela |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
modutil_get_SQL uses signed char pointers to determine the query length. When the data is larger than 0x80, this is translated to a negative number, and then converted wrong to the unsigned int that is the length. Here is an isolated test case that demonstrates the problem:
And the output is:
This then tries to allocate nunecessary 4G of memory. I will send a PR. |
| Comments |
| Comment by Yuval Hager [ 2015-05-12 ] |
| Comment by markus makela [ 2015-05-13 ] |
|
Merged into develop. |
| Comment by markus makela [ 2015-05-13 ] |
|
Test case was added to the internal test suite and the fix was also manually confirmed. |
| Comment by Timofey Turenko [ 2015-05-13 ] |
|
test is in Maxscale source server/core/test/testmodutil.c |