]>
Commit | Line | Data |
---|---|---|
678c8194 MT |
1 | diff -up logrotate-3.7.7/config.c.toolarge logrotate-3.7.7/config.c |
2 | --- logrotate-3.7.7/config.c.toolarge 2008-11-21 12:57:25.000000000 +0100 | |
3 | +++ logrotate-3.7.7/config.c 2008-11-21 12:57:41.000000000 +0100 | |
4 | @@ -530,6 +530,13 @@ static int readConfigFile(const char *co | |
5 | ||
6 | length = sb.st_size; | |
7 | ||
8 | + if (length > 0xffffff) { | |
9 | + message(MESS_ERROR, "file %s too large, probably not a config file.\n", | |
10 | + configFile); | |
11 | + close(fd); | |
12 | + return 1; | |
13 | + } | |
14 | + | |
15 | buf = alloca(length + 2); | |
16 | if (!buf) { | |
17 | message(MESS_ERROR, "alloca() of %d bytes failed\n", (int) length); |