Skip to content

Commit

Permalink
[#491] Fix bug in binding to TCP/IP port
Browse files Browse the repository at this point in the history
The problem is that the port string was created as a 5 chars, while it
can be 5 effective chars plus the string end '\0'.

Close #491
  • Loading branch information
fluca1978 committed Jan 13, 2025
1 parent 3ac30fe commit d95ad89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libpgagroal/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ bind_host(const char* hostname, int port, int** fds, int* length, bool non_block
index = 0;
size = 0;

sport = calloc(1, 5);
sport = calloc(1, 6);
if (sport == NULL)
{
pgagroal_log_fatal("Couldn't allocate memory while binding host");
Expand Down

0 comments on commit d95ad89

Please sign in to comment.