fdisk: check index before access to array [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2011-03-17 22:58:05 +01:00
parent 5298f72839
commit 112b3813d2
1 changed files with 4 additions and 2 deletions

View File

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