Skip to content

Commit

Permalink
Merge pull request #470 from alexlarsson/fix-socket-size
Browse files Browse the repository at this point in the history
Fix podman tests
  • Loading branch information
giuseppe authored Dec 12, 2023
2 parents a3df678 + 26053bd commit 311c053
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/conn_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,9 @@ 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 - 1);
num_read = read(sock->fd, sock->buf, CONN_SOCK_BUF_SIZE);
} else {
num_read = recvfrom(sock->fd, sock->buf, CONN_SOCK_BUF_SIZE - 1, 0, NULL, NULL);
num_read = recvfrom(sock->fd, sock->buf, CONN_SOCK_BUF_SIZE, 0, NULL, NULL);
}

if (num_read < 0)
Expand Down
2 changes: 1 addition & 1 deletion src/conn_sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct remote_sock_s {
gboolean writable;
size_t remaining;
size_t off;
char buf[CONN_SOCK_BUF_SIZE];
char buf[CONN_SOCK_BUF_SIZE + 1]; // Extra byte allows null-termination
};

struct local_sock_s {
Expand Down

0 comments on commit 311c053

Please sign in to comment.