fdisk: check index before access to array [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
5298f72839
commit
112b3813d2
|
@ -43,8 +43,10 @@ static freeblocks freelist[17]; /* 16 partitions can produce 17 vacant slots */
|
|||
|
||||
static void
|
||||
setfreelist(int i, unsigned int f, unsigned int l) {
|
||||
freelist[i].first = f;
|
||||
freelist[i].last = l;
|
||||
if (i < 17) {
|
||||
freelist[i].first = f;
|
||||
freelist[i].last = l;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in New Issue