[PATCH v2 1/5] util: Be more defensive about buffer overruns in read_file()
clang-21.1.7 complains about read_file(), thinking that total_read might
come to exceed buf_size, leading to an out of bounds access at the end of
the function. In fact, the semantics of read()'s return mean this can't
ever happen. But we already have to check for the total_read == buf_size
case, so it's basically free to change it to >= and suppress the error.
Signed-off-by: David Gibson
participants (1)
-
David Gibson