Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix possible buffer overflows on 32 bit platforms #548

Merged
merged 1 commit into from
Oct 20, 2023

Conversation

larskanis
Copy link
Collaborator

@larskanis larskanis commented Oct 20, 2023

Fix is related to #545

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
@larskanis larskanis merged commit dfd5f59 into ged:master Oct 20, 2023
16 of 17 checks passed
@larskanis larskanis changed the title Fix BinaryEncoder::Timestamp and possible buffer overflows on 32 bit platforms Fix possible buffer overflows on 32 bit platforms Oct 20, 2023
@larskanis larskanis deleted the fix-x86 branch October 20, 2023 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant