<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/ruby/test_io_buffer.rb, branch v4.0.2</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[Bug #21787] IO::Buffer: Check addition overflows</title>
<updated>2025-12-17T03:35:38+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2025-11-22T14:43:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c353b625297162024b5a80480664e599dd49a294'/>
<id>c353b625297162024b5a80480664e599dd49a294</id>
<content type='text'>
https://hackerone.com/reports/3437743
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://hackerone.com/reports/3437743
</pre>
</div>
</content>
</entry>
<entry>
<title>IO::Buffer: Fill the test for `IO::Buffer#clear`</title>
<updated>2025-12-17T03:35:38+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2025-11-22T14:40:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f430fbbfacea5690d790dd9060ca4118431fc2fb'/>
<id>f430fbbfacea5690d790dd9060ca4118431fc2fb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove unused local variables in test/ruby/test_io_buffer.rb (#15451)</title>
<updated>2025-12-08T21:58:35+00:00</updated>
<author>
<name>Étienne Barrié</name>
<email>etienne.barrie@gmail.com</email>
</author>
<published>2025-12-08T21:58:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=66bda731901d4588c9df1a671022231ea0d03216'/>
<id>66bda731901d4588c9df1a671022231ea0d03216</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add support for `u128`, `U128`, `s128` and `S128` integers to `IO::Buffer`. (#15399)</title>
<updated>2025-12-06T02:55:32+00:00</updated>
<author>
<name>Samuel Williams</name>
<email>samuel.williams@shopify.com</email>
</author>
<published>2025-12-06T02:55:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a7dc53b91c8475323b34d5a332fdb25d190e277d'/>
<id>a7dc53b91c8475323b34d5a332fdb25d190e277d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix argument handling in `IO::Buffer#each_byte` (#15309)</title>
<updated>2025-11-27T02:10:43+00:00</updated>
<author>
<name>TOMITA Masahiro</name>
<email>tommy@tmtm.org</email>
</author>
<published>2025-11-27T02:10:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2e770cdf773d79327cfdeb8178a1cb9b340f4560'/>
<id>2e770cdf773d79327cfdeb8178a1cb9b340f4560</id>
<content type='text'>
The method incorrectly ignored its first argument and treated the second argument as offset and the third as count.
This change makes the first argument be treated as offset and the second as count.

Also fix incorrect block parameter in comments.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The method incorrectly ignored its first argument and treated the second argument as offset and the third as count.
This change makes the first argument be treated as offset and the second as count.

Also fix incorrect block parameter in comments.</pre>
</div>
</content>
</entry>
<entry>
<title>Fix multiple bugs in `IO::Buffer.map` and update its documentation. (#15264)</title>
<updated>2025-11-21T00:30:42+00:00</updated>
<author>
<name>Alexander Bulancov</name>
<email>6594487+trinistr@users.noreply.github.com</email>
</author>
<published>2025-11-21T00:30:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=aa9e15cb1ecb0de598f816e44a09e016aaa8ef5c'/>
<id>aa9e15cb1ecb0de598f816e44a09e016aaa8ef5c</id>
<content type='text'>
- Buffer's size did not account for offset when mapping the file, leading to possible crashes.
- Size and offset were not checked properly, leading to many situations raising EINVAL errors with generic messages.
- Documentation was wrong.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Buffer's size did not account for offset when mapping the file, leading to possible crashes.
- Size and offset were not checked properly, leading to many situations raising EINVAL errors with generic messages.
- Documentation was wrong.</pre>
</div>
</content>
</entry>
<entry>
<title>io_buffer: Reimplement dcompact for IO::Buffer</title>
<updated>2025-06-17T05:57:02+00:00</updated>
<author>
<name>Kasumi Hanazuki</name>
<email>kasumi@rollingapple.net</email>
</author>
<published>2025-04-01T19:45:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8aac19d5987150cf5c45fee73c7a949ca472f488'/>
<id>8aac19d5987150cf5c45fee73c7a949ca472f488</id>
<content type='text'>
The `source` field in IO::Buffer can have a String or an IO::Buffer
object, if not nil.

- When the `source` is a String object. The `base` field points to the
  memory location of the String content, which can be embedded in
  RSTRING, and in that case, GC compaction can move the memory region
  along with the String object.

  Thus, IO::Buffer needs to pin the `source` object to prevent `base`
  pointer from becoming invalid.

- When the `source` is an IO::Buffer, then `base` is a pointer to a
  malloced or mmapped memory region, managed by the source IO::Buffer.
  In this case, we don't need to pin the source IO::Buffer object,
  since the referred memory region won't get moved by GC.

Closes: [Bug #21210]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The `source` field in IO::Buffer can have a String or an IO::Buffer
object, if not nil.

- When the `source` is a String object. The `base` field points to the
  memory location of the String content, which can be embedded in
  RSTRING, and in that case, GC compaction can move the memory region
  along with the String object.

  Thus, IO::Buffer needs to pin the `source` object to prevent `base`
  pointer from becoming invalid.

- When the `source` is an IO::Buffer, then `base` is a pointer to a
  malloced or mmapped memory region, managed by the source IO::Buffer.
  In this case, we don't need to pin the source IO::Buffer object,
  since the referred memory region won't get moved by GC.

Closes: [Bug #21210]
</pre>
</div>
</content>
</entry>
<entry>
<title>Add test for `IO::Buffer.for(frozen_string) {}` and omit rb_str_{,un}locktmp in that case</title>
<updated>2025-06-16T20:59:10+00:00</updated>
<author>
<name>Benoit Daloze</name>
<email>eregontp@gmail.com</email>
</author>
<published>2025-06-14T11:49:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2956573b09ec78d7735a07fe3d7b2dcc907879fb'/>
<id>2956573b09ec78d7735a07fe3d7b2dcc907879fb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>io_buffer.c: Allow copies between overlapping buffers with #copy and #set_string (#11640)</title>
<updated>2024-11-06T20:55:39+00:00</updated>
<author>
<name>Kasumi Hanazuki</name>
<email>kasumi@rollingapple.net</email>
</author>
<published>2024-11-06T20:55:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=35bf6603372360c7680653328274a670fa1d9f38'/>
<id>35bf6603372360c7680653328274a670fa1d9f38</id>
<content type='text'>
The current implementation of `IO::Buffer#copy` and `#set_string` has
an undefined behavior when the source and destination memory overlaps,
due to the underlying use of the `memcpy` C function.

This patch guarantees the methods to be safe even when copying between
overlapping buffers by replacing `memcpy` with `memmove`,

Fixes: [Bug #20745]</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The current implementation of `IO::Buffer#copy` and `#set_string` has
an undefined behavior when the source and destination memory overlaps,
due to the underlying use of the `memcpy` C function.

This patch guarantees the methods to be safe even when copying between
overlapping buffers by replacing `memcpy` with `memmove`,

Fixes: [Bug #20745]</pre>
</div>
</content>
</entry>
<entry>
<title>Add `IO::Buffer` tests for read and write with length &amp; offset. (#11779)</title>
<updated>2024-10-03T12:29:16+00:00</updated>
<author>
<name>Samuel Williams</name>
<email>samuel.williams@oriontransfer.co.nz</email>
</author>
<published>2024-10-03T12:29:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=cd96af2cb88a0b98add14eacf0005a8bee505d5d'/>
<id>cd96af2cb88a0b98add14eacf0005a8bee505d5d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
