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
|
static void
|
||||||
setfreelist(int i, unsigned int f, unsigned int l) {
|
setfreelist(int i, unsigned int f, unsigned int l) {
|
||||||
freelist[i].first = f;
|
if (i < 17) {
|
||||||
freelist[i].last = l;
|
freelist[i].first = f;
|
||||||
|
freelist[i].last = l;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue