projects
/
users
/
sagi
/
libnvme.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3bf34a6
)
fabrics: check the read() return value
author
Maurizio Lombardi <mlombard@redhat.com>
Mon, 4 Mar 2024 14:05:15 +0000
(15:05 +0100)
committer
Daniel Wagner <wagi@monom.org>
Tue, 5 Mar 2024 08:14:18 +0000
(09:14 +0100)
Do not pass to the is_dmi_uuid_valid() function an invalid len value
if read() fails.
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
src/nvme/fabrics.c
patch
|
blob
|
history
diff --git
a/src/nvme/fabrics.c
b/src/nvme/fabrics.c
index 1f50229f0e7ba8a8aedabe216740acff9822bdec..ac639bdfd3b9581de253384f51664df9defb63ff 100644
(file)
--- a/
src/nvme/fabrics.c
+++ b/
src/nvme/fabrics.c
@@
-1297,6
+1297,8
@@
static int uuid_from_dmi_entries(char *system_uuid)
continue;
len = read(f, buf, 512);
close(f);
+ if (len <= 0)
+ continue;
if (!is_dmi_uuid_valid(buf, len))
continue;