Fix segfault when fragment index is out of range
... (in a corrupt/invalid fragment scenario) Fixes issue #21
This commit is contained in:
parent
25fd05f0e9
commit
c3ba38d1b2
|
@ -240,7 +240,7 @@ int get_fragment_partition(
|
|||
*/
|
||||
for (i = 0; i < num_fragments; i++) {
|
||||
index = get_fragment_idx(fragments[i]);
|
||||
if (index < 0){
|
||||
if (index < 0 || index > (k + m)) {
|
||||
return -EBADHEADER;
|
||||
}
|
||||
if (index < k) {
|
||||
|
|
Loading…
Reference in New Issue