Fix segfault when fragment index is out of range

... (in a corrupt/invalid fragment scenario)

Fixes issue #21
This commit is contained in:
Tushar Gohad 2016-02-14 07:10:37 +00:00
parent 25fd05f0e9
commit c3ba38d1b2
1 changed files with 1 additions and 1 deletions

View File

@ -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) {