From fbe2986a6eadacb2ee0c38debc21104675be51b7 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 13 Mar 2026 13:12:51 +0000 Subject: util/nvmutil: r_type check in rw_gbe_file_part i already send the right arg anyway. this is a preventative bug fix against future maintenance. Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'util') diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index da6336aa..8f20c012 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -1456,7 +1456,11 @@ rw_gbe_file_part(size_t p, int rw_type, uint8_t *mem_offset; - if (rw_type == IO_WRITE || rw_type == IO_PWRITE) + if (rw_type < IO_PREAD || rw_type > IO_PWRITE) + err(errno, "%s: %s: part %lu: invalid rw_type, %d", + fname, rw_type_str, (unsigned long)p, rw_type); + + if (rw_type == IO_PWRITE) invert = 0; /* -- cgit v1.2.1