From 97eec6162c1d79e65d2912a13e27234f7bf3216f Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sat, 26 Dec 2015 12:25:28 +0100 Subject: [PATCH] Bug fix: HFS+ directories could announce more children than they actually have. --- libisofs/hfsplus.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libisofs/hfsplus.c b/libisofs/hfsplus.c index bbace73..cbcdd48 100644 --- a/libisofs/hfsplus.c +++ b/libisofs/hfsplus.c @@ -405,7 +405,8 @@ int create_tree(Ecma119Image *t, IsoNode *iso, uint32_t parent_id) if (cret < 0) return cret; pos = pos->next; - t->hfsp_leafs[cleaf].nchildren++; + if (cret > 0) + t->hfsp_leafs[cleaf].nchildren++; } } return ISO_SUCCESS; @@ -1667,7 +1668,8 @@ int hfsplus_writer_create(Ecma119Image *target) goto ex; } pos = pos->next; - target->hfsp_leafs[0].nchildren++; + if (cret > 0) + target->hfsp_leafs[0].nchildren++; } qsort(target->hfsp_leafs, target->hfsp_nleafs,