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

[Bug #19754] Make IO::Buffer#get_string check offset range #8016

Merged
merged 1 commit into from Sep 12, 2023

Conversation

nobu
Copy link
Member

@nobu nobu commented Jul 3, 2023

@ioquatix
Copy link
Member

Thanks please let me check it.

@ioquatix
Copy link
Member

This looks okay to me.

@ioquatix ioquatix merged commit 19346c2 into ruby:master Sep 12, 2023
87 of 88 checks passed
@ioquatix
Copy link
Member

ioquatix commented Sep 13, 2023

I merged this as it appears to fix a bug, but I think the bug is that length is computed incorrectly:

TestIOBuffer#test_get_string
io_buffer_validate_range(0x559895c17de0, 0, 16)
io_buffer_validate_range(0x559895c17de0, 0, 16)
io_buffer_validate_range(0x559895c17de0, 0, 16)
io_buffer_validate_range(0x559895c17de0, 0, 129)
io_buffer_validate_range(0x559895c17de0, 129, 18446744073709551615) # Something wrong here.

I'll check why this is happening and fix it.

@ioquatix
Copy link
Member

See #8427 for the root cause fix.

nagachika added a commit to nagachika/ruby that referenced this pull request Oct 28, 2023
	[Bug #19754] Make `IO::Buffer#get_string` check `offset` range
	 (ruby#8016)

	---
	 io_buffer.c                 | 3 +++
	 test/ruby/test_io_buffer.rb | 8 ++++++++
	 2 files changed, 11 insertions(+)
nagachika added a commit to nagachika/ruby that referenced this pull request Oct 28, 2023
	[Bug #19754] Make `IO::Buffer#get_string` check `offset` range
	 (ruby#8016)

	---
	 io_buffer.c                 | 3 +++
	 test/ruby/test_io_buffer.rb | 8 ++++++++
	 2 files changed, 11 insertions(+)
matzbot pushed a commit that referenced this pull request Nov 6, 2023
	[Bug #19754] Make `IO::Buffer#get_string` check `offset` range
	 (#8016)

	---
	 io_buffer.c                 | 3 +++
	 test/ruby/test_io_buffer.rb | 8 ++++++++
	 2 files changed, 11 insertions(+)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants