aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2005-09-12 19:16:11 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2005-09-12 19:16:11 +0000
commit6adac3addac885d91fca0bad20b80ffab030cb97 (patch)
treee322ed65b42b49480394456ef8e850f24507c3c5
parent4165e8075871e4344a43b937c135013c3103cbb8 (diff)
downloadbusybox-w32-6adac3addac885d91fca0bad20b80ffab030cb97.tar.gz
busybox-w32-6adac3addac885d91fca0bad20b80ffab030cb97.tar.bz2
busybox-w32-6adac3addac885d91fca0bad20b80ffab030cb97.zip
Kunihiko IMAI writes:
We're using busybox and thank the authors. I found a short buffer allocation at busybox/sysklod/syslod.c. It mis-declares length of filenames, seems to forget for '\0' or two column numbered suffix of backup files (ex. messages.10). Here is a patch for the problem. Thanks. git-svn-id: svn://busybox.net/trunk/busybox@11429 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--sysklogd/syslogd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index aecd35d58..8f9d75cc6 100644
--- a/sysklogd/syslogd.c
+++ b/sysklogd/syslogd.c
@@ -333,7 +333,7 @@ static void message(char *fmt, ...)
333 && (lseek(fd,0,SEEK_END) > logFileSize) ) { 333 && (lseek(fd,0,SEEK_END) > logFileSize) ) {
334 if(logFileRotate > 0) { 334 if(logFileRotate > 0) {
335 int i; 335 int i;
336 char oldFile[(strlen(logFilePath)+3)], newFile[(strlen(logFilePath)+3)]; 336 char oldFile[(strlen(logFilePath)+4)], newFile[(strlen(logFilePath)+4)];
337 for(i=logFileRotate-1;i>0;i--) { 337 for(i=logFileRotate-1;i>0;i--) {
338 sprintf(oldFile, "%s.%d", logFilePath, i-1); 338 sprintf(oldFile, "%s.%d", logFilePath, i-1);
339 sprintf(newFile, "%s.%d", logFilePath, i); 339 sprintf(newFile, "%s.%d", logFilePath, i);