-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix possible buffer overflows on 32 bit systems
Comparing pointers after adding lengths is dangerous, since the length can overflow the pointer, so that the comparison leads to wrong results. Comparing lengths only fixes this issue. This lead to segfault in the following spec on x86: it "should raise an error at grabage COPY format" do expect{ decoder.decode("123\t \0\\\t\\") } .to raise_error(ArgumentError, /premature.*at position: 7$/) end
- Loading branch information
Showing
1 changed file
with
7 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters