From efacbcb4973161c12cc9630d243669845db41a17 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Wed, 21 May 2014 04:42:29 +0200 Subject: [PATCH] ubi: fix false positive in volume_find An off-by-one made the string compare check only the string length and not the terminating \0 which lead to rootfs being found as rootfs_data. Signed-off-by: Daniel Golle --- libfstools/ubi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libfstools/ubi.c b/libfstools/ubi.c index 42f76ca..3051720 100644 --- a/libfstools/ubi.c +++ b/libfstools/ubi.c @@ -138,7 +138,7 @@ static int ubi_volume_match(struct volume *v, char *name, int ubi_num, int volid volname = read_string_from_file(voldir, "name"); - if (strncmp(name, volname, strlen(volname))) + if (strncmp(name, volname, strlen(volname) + 1)) return -1; p = calloc(1, sizeof(struct ubi_priv)); -- 2.11.0