Bug #36997 | Possible Overflow in ReadLong | ||
---|---|---|---|
Submitted: | 27 May 2008 7:35 | Modified: | 8 Jul 2008 15:03 |
Reporter: | Christos Pavlides | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / NET | Severity: | S2 (Serious) |
Version: | 5.3.0.0 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[27 May 2008 7:35]
Christos Pavlides
[27 May 2008 9:34]
Tonci Grgin
Hi Christos and thanks for your report. Truly, source reveals this change in latest c/NET sources but I can't find why it was introduced (besides speedup). At least, this change should be documented. Workaround would be to build your own driver with proposed change. Verified as described.
[27 May 2008 9:49]
Christos Pavlides
Hi Tonci, well I think the latest changes that were made to the trunk are a step in the right direction regarding the performance of the connector. Although I have not tested the performance benefit of the changes yet, just by looking at the changes I am sure they will significantly boost performance. The issue is not why they were made, but if they are correct in all usages. Doing "unsafe" parsing/writing of any value like this is definetely a proper optimization to do in such performance sensitive operations, but they have to be made very carefully in order to limit the possibilities of serious problems in the future. Also their scope must be as restrictive as possible to make sure they are only used only when absolutely necessary.
[27 May 2008 21:15]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/47112
[27 May 2008 21:16]
Reggie Burnett
Fixed in 5.3 We fixed this by renaming the ReadLong method to ReadULong and using ulong values inside the function. Also we added an assert inside ReadInteger to catch any cases where that method is called with a num bytes > 4.
[28 May 2008 6:08]
Christos Pavlides
Thank you Reggie
[8 Jul 2008 15:03]
Tony Bedford
An entry has been added to the 5.3.0 Changelog: Possible overflow in MySqlPacket.ReadLong().