diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/partitions/ldm.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/partitions/ldm.c b/fs/partitions/ldm.c index a2a14cd48a8..dd6efdba939 100644 --- a/fs/partitions/ldm.c +++ b/fs/partitions/ldm.c @@ -1335,6 +1335,11 @@ static bool ldm_frag_add (const u8 *data, int size, struct list_head *frags) list_add_tail (&f->list, frags); found: + if (rec >= f->num) { + ldm_error("REC value (%d) exceeds NUM value (%d)", rec, f->num); + return false; + } + if (f->map & (1 << rec)) { ldm_error ("Duplicate VBLK, part %d.", rec); f->map &= 0x7F; /* Mark the group as broken */ |