svn commit: branches/busybox_1_00_stable/busybox/sysklogd

andersen at busybox.net andersen at busybox.net
Mon Sep 12 19:17:27 UTC 2005


Author: andersen
Date: 2005-09-12 12:17:03 -0700 (Mon, 12 Sep 2005)
New Revision: 11430

Log:
Kunihiko IMAI writes:

Hi,

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.



Modified:
   branches/busybox_1_00_stable/busybox/sysklogd/syslogd.c


Changeset:
Modified: branches/busybox_1_00_stable/busybox/sysklogd/syslogd.c
===================================================================
--- branches/busybox_1_00_stable/busybox/sysklogd/syslogd.c	2005-09-12 19:16:11 UTC (rev 11429)
+++ branches/busybox_1_00_stable/busybox/sysklogd/syslogd.c	2005-09-12 19:17:03 UTC (rev 11430)
@@ -333,7 +333,7 @@
 				&& (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);




More information about the busybox-cvs mailing list