Large rows cannot be read if packet_size exceeds max buffer size
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Drizzle |
Fix Released
|
Low
|
Andrew Hutchings | ||
7.0 |
Fix Released
|
Low
|
Andrew Hutchings | ||
Drizzle Client & Protocol Library |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
In rev 147, there was a bug fix for bug #571579 - I am not able to view that bug report, but I assume it outlines a problem which we were also seeing (i.e. potential access of uninitialized memory from con->buffer_ptr). It appears though that there is a new bug introduced by that fix. For large rows, the amount of data in the packet may exceed the max size of our read buffer. In the following code, if our buffer is already full, but still we have not read con->packet_size worth of data, we will go to drizzle_state_read and attempt to read 0 bytes, which will return 0 and thus disconnect us.
drizzle_return_t drizzle_
{
drizzle_
if (con->packet_size != 0 && con->buffer_size < con->packet_size)
{
drizzle_
return DRIZZLE_RETURN_OK;
}
I believe the fix is to change the if statement above to read:
if (con->packet_size != 0 && con->buffer_size < con->packet_size && con->buffer_size < 5)
We only need up to 5 bytes of data for the purposes of drizzle_
Related branches
- Drizzle Merge Team: Pending requested
-
Diff: 25 lines (+7/-6)1 file modifiedlibdrizzle/row.c (+7/-6)
Changed in drizzle: | |
status: | Triaged → Fix Committed |
milestone: | 2010-11-08 → 2010-10-25 |
Changed in libdrizzle: | |
status: | New → Won't Fix |
Changed in drizzle: | |
status: | Fix Committed → Fix Released |
I was running into this problem, and this fixed it for me. I don't like that the number 5 is hard coded in here, but it works for me for the moment. Would it be helpful to put this fix in a bzr branch?