mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
[Bug #20933] Fix IO::Buffer overlap calculation
The allocated buffers may be consecutive memory addresses. This will mean that `b->base == a->base + a->size` even though `a` and `b` are separate buffers.
This commit is contained in:
parent
8010d79bb4
commit
7341a4fc07
Notes:
git
2024-12-09 16:52:20 +00:00
1 changed files with 1 additions and 1 deletions
|
@ -3395,7 +3395,7 @@ io_buffer_overlaps(const struct rb_io_buffer *a, const struct rb_io_buffer *b)
|
|||
return io_buffer_overlaps(b, a);
|
||||
}
|
||||
|
||||
return (b->base >= a->base) && (b->base <= (void*)((unsigned char *)a->base + a->size));
|
||||
return (b->base >= a->base) && (b->base < (void*)((unsigned char *)a->base + a->size));
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue