Skip to content

Commit adb28c4

Browse files
dwsuseigaw
authored andcommitted
tree: use strtou32 to read lba_size
The lba_size variable is of type int, thus we should use nvme_strtou32 and avoid overwriting memory. Signed-off-by: Daniel Wagner <[email protected]>
1 parent 2ba04fe commit adb28c4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/nvme/tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2455,7 +2455,7 @@ static int nvme_ns_init(const char *path, struct nvme_ns *ns)
24552455
struct sysfs_attr_table base[] = {
24562456
{ &ns->nsid, nvme_strtou32, true, "nsid" },
24572457
{ &size, nvme_strtou64, true, "size" },
2458-
{ &ns->lba_size, nvme_strtou64, true, "queue/logical_block_size" },
2458+
{ &ns->lba_size, nvme_strtou32, true, "queue/logical_block_size" },
24592459
{ ns->eui64, nvme_strtoeuid, false, "eui" },
24602460
{ ns->nguid, nvme_strtouuid, false, "nguid" },
24612461
{ ns->uuid, nvme_strtouuid, false, "uuid" }

0 commit comments

Comments
 (0)