diff mbox series

[1/4] blkid: probe_ntfs: fix attr->len endian swap size

Message ID 20260924210421.3631790-2-sandeen@redhat.com
State New
Headers show
Series e2fsprogs: blkid: misc fixes | expand

Commit Message

Eric Sandeen Sept. 24, 2026, 9:02 p.m. UTC
From: Eric Sandeen <esandeen@redhat.com>

attr->len is a __u32, so use blkid_le32(), and change attr_len (to which
it is assigned) to an unsigned int as well.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
 lib/blkid/probe.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/lib/blkid/probe.c b/lib/blkid/probe.c
index 6a3bb247..31d048db 100644
--- a/lib/blkid/probe.c
+++ b/lib/blkid/probe.c
@@ -689,8 +689,8 @@  static int probe_ntfs(struct blkid_probe *probe,
 	struct file_attribute *attr;
 	char		uuid_str[17], label_str[129], *cp;
 	int		bytes_per_sector, sectors_per_cluster;
-	int		mft_record_size, attr_off, attr_len;
-	unsigned int	i, attr_type, val_len;
+	int		mft_record_size, attr_off;
+	unsigned int	i, attr_len, attr_type, val_len;
 	int		val_off;
 	__u64		nr_clusters;
 	blkid_loff_t off;
@@ -752,7 +752,7 @@  static int probe_ntfs(struct blkid_probe *probe,
 
 	while (1) {
 		attr = (struct file_attribute *) (buf_mft + attr_off);
-		attr_len = blkid_le16(attr->len);
+		attr_len = blkid_le32(attr->len);
 		attr_type = blkid_le32(attr->type);
 		val_off = blkid_le16(attr->value_offset);
 		val_len = blkid_le32(attr->value_len);