Found by coverity. Callers check this parameter already, but the function is exported by libmpathcmd, so make sure we don't write '\0' to reply[-1]. Signed-off-by: Martin Wilck <mwilck@xxxxxxxx> --- libmpathcmd/mpath_cmd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libmpathcmd/mpath_cmd.c b/libmpathcmd/mpath_cmd.c index 60b2d96..d7c3371 100644 --- a/libmpathcmd/mpath_cmd.c +++ b/libmpathcmd/mpath_cmd.c @@ -170,6 +170,8 @@ int mpath_recv_reply_data(int fd, char *reply, size_t len, { ssize_t ret; + if (len <= 0) + return 0; ret = read_all(fd, reply, len, timeout); if (ret < 0) return ret; -- 2.45.2