mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
[Bug #20755] Frozen string should not be writable via IO::Buffer
This commit is contained in:
parent
3ebc85e240
commit
35e124832e
Notes:
git
2024-10-01 10:59:57 +00:00
2 changed files with 27 additions and 1 deletions
|
@ -843,7 +843,8 @@ rb_io_buffer_get_bytes(VALUE self, void **base, size_t *size)
|
|||
static inline void
|
||||
io_buffer_get_bytes_for_writing(struct rb_io_buffer *buffer, void **base, size_t *size)
|
||||
{
|
||||
if (buffer->flags & RB_IO_BUFFER_READONLY) {
|
||||
if (buffer->flags & RB_IO_BUFFER_READONLY ||
|
||||
(!NIL_P(buffer->source) && OBJ_FROZEN(buffer->source))) {
|
||||
rb_raise(rb_eIOBufferAccessError, "Buffer is not writable!");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue