diff options
author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2022-02-17 19:13:34 +0100 |
---|---|---|
committer | Sander Vrijders <sander@ouroboros.rocks> | 2022-02-18 08:43:14 +0100 |
commit | 26f9d9880cdd8392379516d795a3cabb5f412728 (patch) | |
tree | ef786ca6624c4ed967b96b7d60068a5c5460d9e0 /src/ipcpd/udp/main.c | |
parent | 9f80503e9e970ba828bc347d13eaad9e3c36b8f5 (diff) | |
download | ouroboros-26f9d9880cdd8392379516d795a3cabb5f412728.tar.gz ouroboros-26f9d9880cdd8392379516d795a3cabb5f412728.zip |
ipcpd: Fix potential overflow in DDNS resolver
The count value could be IPCP_UDP_BUF_SIZE, overflowing buf.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/ipcpd/udp/main.c')
-rw-r--r-- | src/ipcpd/udp/main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ipcpd/udp/main.c b/src/ipcpd/udp/main.c index 6a3fb24a..e6caea45 100644 --- a/src/ipcpd/udp/main.c +++ b/src/ipcpd/udp/main.c @@ -765,7 +765,7 @@ static uint32_t ddns_resolve(char * name, close(pipe_fd[1]); - count = read(pipe_fd[0], buf, IPCP_UDP_BUF_SIZE); + count = read(pipe_fd[0], buf, IPCP_UDP_BUF_SIZE - 1); if (count <= 0) { log_err("Failed to communicate with nslookup."); close(pipe_fd[0]); |