]>
Commit | Line | Data |
---|---|---|
8d5a43f0 MT |
1 | From f798bf23af8e5a0eae38931912e2b67e1d45aca4 Mon Sep 17 00:00:00 2001 |
2 | From: Tobias Heider <tobhe@users.noreply.github.com> | |
3 | Date: Sat, 12 Aug 2023 21:59:21 +0200 | |
4 | Subject: [PATCH] dhcpcd: Fix off-by-one overflow when read() writes full | |
5 | BUFSIZ (#236) | |
6 | ||
7 | --- | |
8 | src/dhcpcd.c | 2 +- | |
9 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
10 | ||
11 | diff --git a/src/dhcpcd.c b/src/dhcpcd.c | |
12 | index e06733d3..688a3a6d 100644 | |
13 | --- a/src/dhcpcd.c | |
14 | +++ b/src/dhcpcd.c | |
15 | @@ -1822,7 +1822,7 @@ dhcpcd_stderr_cb(void *arg, unsigned short events) | |
16 | if (!(events & ELE_READ)) | |
17 | return; | |
18 | ||
19 | - len = read(ctx->stderr_fd, log, sizeof(log)); | |
20 | + len = read(ctx->stderr_fd, log, sizeof(log) - 1); | |
21 | if (len == -1) { | |
22 | if (errno != ECONNRESET) | |
23 | logerr(__func__); | |
24 | -- | |
25 | 2.39.2 | |
26 |