Package: micro-evtd
Version: 3.3.3-6+lenny3
Tags: patch

Hi,

at micro_evtd.c:1018 sprintf() is used to append to a buffer, but the 
destination and the source target happens to be one and the same object 
(message). This leads to undefined behaviour, see NOTES of sprintf(3). 

Patch is attached.

thanks

-- 
pub 4096R/0E4BD0AB 2003-03-18 <people.fccf.net/danchev/key pgp.mit.edu>
--- micro_evtd.c.orig	2008-06-26 20:27:24.000000000 +0300
+++ micro_evtd.c	2009-06-28 13:52:33.000000000 +0300
@@ -1015,7 +1015,7 @@
 			tworktime = ltime + iOnTime;
 			decode_time = localtime(&tworktime);
 
-			sprintf(message, "%s-%02d/%02d %02d:%02d", message,
+			sprintf(message+strlen(message), "-%02d/%02d %02d:%02d",
 				decode_time->tm_mon+1, decode_time->tm_mday, decode_time->tm_hour, decode_time->tm_min);
 		}
 

Reply via email to