X-Git-Url: http://git.sven.stormbind.net/?p=sven%2Fexfat-utils.git;a=blobdiff_plain;f=libexfat%2Fnode.c;fp=libexfat%2Fnode.c;h=f3d10e0ef8d05cc1a6be8c162f919b73e1071011;hp=ba5146a0b4667ed38fe473166a8efd857ae2fad8;hb=9420cfdeee25e4d97e7fc6f7cbb286e5089caccb;hpb=9c08378bfbf14696495ca8e3507d7f46daba8a3f diff --git a/libexfat/node.c b/libexfat/node.c index ba5146a..f3d10e0 100644 --- a/libexfat/node.c +++ b/libexfat/node.c @@ -3,7 +3,7 @@ exFAT file system implementation library. Free exFAT implementation. - Copyright (C) 2010-2014 Andrew Nayenko + Copyright (C) 2010-2015 Andrew Nayenko This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -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; } @@ -963,7 +973,7 @@ int exfat_mkdir(struct exfat* ef, const char* path) int rc; struct exfat_node* node; - rc = create(ef, path, EXFAT_ATTRIB_ARCH | EXFAT_ATTRIB_DIR); + rc = create(ef, path, EXFAT_ATTRIB_DIR); if (rc != 0) return rc; rc = exfat_lookup(ef, &node, path);