From b2844d89acbc3e50df443d78a97507aca918ebd2 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Fri, 16 Aug 2019 09:58:03 -0400 Subject: [PATCH] dos33: add error message instead of hanging if reading too far in VTOC was trying to use some unused parts of track $11, didn't go well --- dos33fs-utils/dos33.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dos33fs-utils/dos33.c b/dos33fs-utils/dos33.c index 278f4dba..30374f99 100644 --- a/dos33fs-utils/dos33.c +++ b/dos33fs-utils/dos33.c @@ -693,6 +693,11 @@ continue_parsing_catalog: /* Read in Catalog Sector */ lseek(fd,DISK_OFFSET(catalog_track,catalog_sector),SEEK_SET); result=read(fd,sector_buffer,BYTES_PER_SECTOR); + if (result!=BYTES_PER_SECTOR) { + fprintf(stderr,"Error reading at $%02X:$%02X\n", + catalog_track,catalog_sector); + return ERROR_NO_SPACE; + } /* Find empty directory entry */ i=0;