Commit 7f7a058
committed
patina_internal_collections: Prevent out-of-bounds access in resize()
Add bounds checking before accessing buffer[idx] in Storage::resize().
When resizing to a buffer with no free space (idx >= buffer.len()),
set available to null instead of attempting to access out-of-bounds
memory.
Signed-off-by: Michael Kubacki <[email protected]>1 parent 3cf95e9 commit 7f7a058
1 file changed
+29
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
243 | | - | |
244 | | - | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
245 | 249 | | |
246 | 250 | | |
247 | 251 | | |
| |||
700 | 704 | | |
701 | 705 | | |
702 | 706 | | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
703 | 730 | | |
704 | 731 | | |
705 | 732 | | |
| |||
0 commit comments