Commit 6dd0d7d
Add overflow check in bgzf_index_load_hfile()
This function reads an item count from the input file and uses
it to allocate an array of file offsets. It's possible for
this to overflow, resulting in an attempt to malloc(0) and,
if that returns a valid pointer, an attempt to zero 16 bytes
in a zero-length allocation.
Fix by checking that the allocation will not overflow.
Thanks to Harrison Green for reporting this.1 parent d4c747b commit 6dd0d7d
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2471 | 2471 | | |
2472 | 2472 | | |
2473 | 2473 | | |
| 2474 | + | |
| 2475 | + | |
| 2476 | + | |
2474 | 2477 | | |
2475 | 2478 | | |
2476 | 2479 | | |
| |||
0 commit comments