Skip to content

Commit

Permalink
Merge pull request #467 from giuseppe/fix-end-of-buffer-write
Browse files Browse the repository at this point in the history
src: fix write after end of buffer
  • Loading branch information
rhatdan authored Nov 30, 2023
2 parents 633ac6b + 3605a36 commit cfb141f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/conn_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ static gboolean read_remote_sock(struct remote_sock_s *sock)
}

if (SOCK_IS_STREAM(sock->sock_type)) {
num_read = read(sock->fd, sock->buf, CONN_SOCK_BUF_SIZE);
num_read = read(sock->fd, sock->buf, CONN_SOCK_BUF_SIZE - 1);
} else {
num_read = recvfrom(sock->fd, sock->buf, CONN_SOCK_BUF_SIZE - 1, 0, NULL, NULL);
}
Expand Down

0 comments on commit cfb141f

Please sign in to comment.