← Commit list

cd8427b8e

Denys Vlasenko
Denys Vlasenko
2026-07-03
SUCCESS Duration: 144s

Subject

svlogd: fix buffer overrun

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0
gcc -Wp,-MD,applets/.usage.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer      -Iinclude -Iinclude -o applets/usage applets/usage.c

Build Log

(log yok)

Commit Diff GitHub →

runit/svlogd.c+2 -2
@@ -244,7 +244,7 @@ struct globals {
#define INIT_G() do { \
setup_common_bufsiz(); \
SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
- linemax = 1000; \
+ linemax = COMMON_BUFSIZE - 26; \
/*buflen = 1024;*/ \
linecomplete = 1; \
replace = ""; \
@@ -1069,7 +1069,7 @@ int svlogd_main(int argc, char **argv)
}
if (opt & 2) if (!repl) repl = '_'; // -R
if (opt & 4) { // -l
- linemax = xatou_range(l, 0, COMMON_BUFSIZE-26);
+ linemax = xatou_range(l, 0, COMMON_BUFSIZE - 26);
if (linemax == 0)
linemax = COMMON_BUFSIZE-26;
if (linemax < 256)