Skip to content

Commit

Permalink
Fix misuse of read() length parameter, found by Coverity Scan
Browse files Browse the repository at this point in the history
Signed-off-by: Joachim Wiberg <[email protected]>
  • Loading branch information
troglobit committed Jan 5, 2024
1 parent 0fa348b commit a386203
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,11 @@ static void check_detail(char *cmd, size_t len)
detail = 0;
}

static int ipc_read(int sd, char *cmd, ssize_t len)
static int ipc_read(int sd, char *cmd, size_t cmd_len)
{
while ((len = read(sd, cmd, len - 1)) == -1) {
ssize_t len;

while ((len = read(sd, cmd, cmd_len - 1)) == -1) {
switch (errno) {
case EAGAIN:
case EINTR:
Expand Down

0 comments on commit a386203

Please sign in to comment.