---
 cmds-restore.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/cmds-restore.c b/cmds-restore.c
index a8c67a5..6c2ea8a 100644
--- a/cmds-restore.c
+++ b/cmds-restore.c
@@ -509,6 +509,9 @@ static int set_file_xattrs(struct btrfs_root *root, u64 
inode,
 
                while (cur < total_len) {
                        len = btrfs_dir_name_len(leaf, di);
+                        if (len == 0) {
+                                goto out;
+                        }
                        if (len > name_len) {
                                free(name);
                                name = (char *) malloc(len + 1);
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to