Assert that q can't be NULL. 'empty' is always non-NULL when DIREMPTY

is set earlier.

MFC after:	1 month
This commit is contained in:
Xin LI 2019-04-03 07:09:28 +00:00
parent 62c7ea1f1d
commit f806eb62a4

View File

@ -35,6 +35,7 @@ static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <assert.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
@ -520,7 +521,8 @@ readDosDirSection(int f, struct bootblock *boot, struct fatEntry *fat,
empcl, empty - buffer,
cl, p - buffer, 1) == FSFATAL)
return FSFATAL;
q = empcl == cl ? empty : buffer;
q = ((empcl == cl) ? empty : buffer);
assert(q != NULL);
for (; q < p; q += 32)
*q = SLOT_DELETED;
mod |= THISMOD|FSDIRMOD;