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.
This commit is contained in:
Eric Andersen 2005-09-12 19:16:11 +00:00
parent b1fe462116
commit 2c6b41812f

View File

@ -333,7 +333,7 @@ static void message(char *fmt, ...)
&& (lseek(fd,0,SEEK_END) > logFileSize) ) { && (lseek(fd,0,SEEK_END) > logFileSize) ) {
if(logFileRotate > 0) { if(logFileRotate > 0) {
int i; 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--) { for(i=logFileRotate-1;i>0;i--) {
sprintf(oldFile, "%s.%d", logFilePath, i-1); sprintf(oldFile, "%s.%d", logFilePath, i-1);
sprintf(newFile, "%s.%d", logFilePath, i); sprintf(newFile, "%s.%d", logFilePath, i);