aboutsummaryrefslogtreecommitdiff
path: root/sysklogd
diff options
context:
space:
mode:
authorGravatar Eric Andersen <andersen@codepoet.org>2005-09-12 19:16:11 +0000
committerGravatar Eric Andersen <andersen@codepoet.org>2005-09-12 19:16:11 +0000
commit2c6b41812febab045917c0be15ff8427191df0f4 (patch)
treee322ed65b42b49480394456ef8e850f24507c3c5 /sysklogd
parentb1fe4621169b2a7f2eea966932703596583a37b6 (diff)
downloadbusybox-2c6b41812febab045917c0be15ff8427191df0f4.tar.gz
busybox-2c6b41812febab045917c0be15ff8427191df0f4.tar.bz2
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.
Diffstat (limited to 'sysklogd')
-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, ...)
&& (lseek(fd,0,SEEK_END) > logFileSize) ) {
if(logFileRotate > 0) {
int i;
- char oldFile[(strlen(logFilePath)+3)], newFile[(strlen(logFilePath)+3)];
+ char oldFile[(strlen(logFilePath)+4)], newFile[(strlen(logFilePath)+4)];
for(i=logFileRotate-1;i>0;i--) {
sprintf(oldFile, "%s.%d", logFilePath, i-1);
sprintf(newFile, "%s.%d", logFilePath, i);