Skip to content

Commit 0bc38f5

Browse files
committed
adf_dir / adfDirCheck: ensure processing a directory.
Meaning - the nSect parameter points to the volume's root block or a directory block.
1 parent f681f01 commit 0bc38f5

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/adf_dir.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1355,7 +1355,9 @@ unsigned adfDirCheck( const struct AdfVolume * const vol,
13551355
{
13561356
struct AdfEntryBlock parent, entryBlk;
13571357

1358-
if ( adfReadEntryBlock( vol, nSect, &parent ) != ADF_RC_OK )
1358+
if ( adfReadEntryBlock( vol, nSect, &parent ) != ADF_RC_OK ||
1359+
( parent.type != ADF_ST_ROOT &&
1360+
parent.type != ADF_ST_DIR ) )
13591361
return 1;
13601362

13611363
unsigned nErrors = 0;

0 commit comments

Comments
 (0)