{
off_t off;
- *buffer = malloc(boot->FATsecs * boot->BytesPerSec);
+ *buffer = calloc(boot->FATsecs, boot->BytesPerSec);
if (*buffer == NULL) {
perror("No space for FAT");
return 0;
off_t off;
int ret = FSOK;
- buffer = malloc(fatsz = boot->FATsecs * boot->BytesPerSec);
+ fatsz = boot->FATsecs * boot->BytesPerSec;
+ buffer = calloc(boot->FATsecs, boot->BytesPerSec);
if (buffer == NULL) {
perror("No space for FAT");
return FSFATAL;
}
- memset(buffer, 0, fatsz);
boot->NumFree = 0;
p = buffer;
if (correct_fat) {