aboutsummaryrefslogtreecommitdiffstats
path: root/libexfat/node.c
diff options
context:
space:
mode:
Diffstat (limited to 'libexfat/node.c')
-rw-r--r--libexfat/node.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/libexfat/node.c b/libexfat/node.c
index 912b4fc..6e18c09 100644
--- a/libexfat/node.c
+++ b/libexfat/node.c
@@ -454,11 +454,21 @@ static int readdir(struct exfat* ef, const struct exfat_node* parent,
break;
default:
- if (entry->type & EXFAT_ENTRY_VALID)
+ if (!(entry->type & EXFAT_ENTRY_VALID))
+ break; /* deleted entry, ignore it */
+ if (!(entry->type & EXFAT_ENTRY_OPTIONAL))
{
- exfat_error("unknown entry type 0x%hhx", entry->type);
+ exfat_error("unknown entry type %#hhx", entry->type);
goto error;
}
+ /* optional entry, warn and skip */
+ exfat_warn("unknown entry type %#hhx", entry->type);
+ if (continuations == 0)
+ {
+ exfat_error("unexpected continuation");
+ goto error;
+ }
+ --continuations;
break;
}