mirror of
https://github.com/odin-lang/Odin.git
synced 2026-06-13 13:53:43 +00:00
Merge pull request #6791 from gco-bmx/fix-test-shrink-buffer-overflow
fix buffer overflow when running a test which shrinks a dynamic array…
This commit is contained in:
@@ -344,7 +344,7 @@ rb_resize_bytes_non_zeroed :: proc(
|
||||
}
|
||||
}
|
||||
result = rb_alloc_bytes_non_zeroed(stack, size, alignment) or_return
|
||||
runtime.mem_copy_non_overlapping(raw_data(result), ptr, old_size)
|
||||
runtime.mem_copy_non_overlapping(raw_data(result), ptr, min(old_size, size))
|
||||
err = rb_free(stack, ptr)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user