[OpenWrt-Devel] [fstools PATCH: 1/4] libblkid-tiny: fix wrong btrfs label length

Ansuel Smith ansuelsmth at gmail.com
Sun Jun 16 13:00:47 EDT 2019


Btrfs label length is 256 included the termination char ( '\0' ) as the real max length is 255 (less than 256 from the wiki).

Signed-off-by: Ansuel Smith <ansuelsmth at gmail.com>
---
 libblkid-tiny/btrfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libblkid-tiny/btrfs.c b/libblkid-tiny/btrfs.c
index 7ce3dff..cf33db5 100644
--- a/libblkid-tiny/btrfs.c
+++ b/libblkid-tiny/btrfs.c
@@ -70,7 +70,7 @@ static int probe_btrfs(blkid_probe pr, const struct blkid_idmag *mag)
 	if (*bfs->label)
 		blkid_probe_set_label(pr,
 				(unsigned char *) bfs->label,
-				sizeof(bfs->label));
+				sizeof(bfs->label) - 1);
 
 	blkid_probe_set_uuid(pr, bfs->fsid);
 	blkid_probe_set_uuid_as(pr, bfs->dev_item.uuid, "UUID_SUB");
-- 
2.20.1


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list