logrotate/logrotate-3.8.4-big-config.patch
2013-05-14 08:56:42 +02:00

19 lines
428 B
Diff

Index: config.c
===================================================================
--- a/config.c (revision 415)
+++ b/config.c (working copy)
@@ -695,6 +695,13 @@
length = sb.st_size;
+ if (length > 0xffffff) {
+ message(MESS_ERROR, "file %s too large, probably not a config file.\n",
+ configFile);
+ close(fd);
+ return 1;
+ }
+
/* We can't mmap empty file... */
if (length == 0) {
message(MESS_DEBUG,