btrfs-progs: check: fix memset range
authorSilvio Fricke <silvio.fricke@gmail.com>
Tue, 29 Sep 2015 17:10:46 +0000 (19:10 +0200)
committerDavid Sterba <dsterba@suse.com>
Fri, 2 Oct 2015 15:56:28 +0000 (17:56 +0200)
Signed-off-by: Silvio Fricke <silvio.fricke@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-check.c

index fe3f782b2172933952272b7ce58e8d3891218405..4225b211383736e3044f77e8195e6dc93d4b8e28 100644 (file)
@@ -2969,7 +2969,7 @@ static struct root_backref *get_root_backref(struct root_record *rec,
        }
 
        backref = malloc(sizeof(*backref) + namelen + 1);
-       memset(backref, 0, sizeof(*backref));
+       memset(backref, 0, sizeof(*backref) + namelen + 1);
        backref->ref_root = ref_root;
        backref->dir = dir;
        backref->index = index;