aboutsummaryrefslogtreecommitdiffstats
path: root/libexfat/node.c
diff options
context:
space:
mode:
authorrelan <relan@users.noreply.github.com>2015-07-11 11:07:53 +0300
committerrelan <relan@users.noreply.github.com>2015-08-24 08:36:19 +0300
commit8c4c5fabc4f571fbb3e2ae6429958be8a4d62807 (patch)
treebe2f2adb0f27f0194d83aea28624bf5f93fde066 /libexfat/node.c
parentfeaadd56fcf31d9aa5346005ff4558db996a42d2 (diff)
downloadandroid_external_exfat-8c4c5fabc4f571fbb3e2ae6429958be8a4d62807.tar.gz
android_external_exfat-8c4c5fabc4f571fbb3e2ae6429958be8a4d62807.tar.bz2
android_external_exfat-8c4c5fabc4f571fbb3e2ae6429958be8a4d62807.zip
Recognize optional entries.
Memory cards formatted by Sony cameras have mysterious 0xe1 entries. Looks like they can be safely ignored. So now if entry type is unknown and has 0x20 flag set there will be a warning instead of error.
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;
}