rename to a mor general name
git-svn-id: https://svn.disconnected-by-peer.at/svn/linamh/trunk/genlink@2460 6952d904-891a-0410-993b-d76249ca496b
This commit is contained in:
31
sys-apps/micro_evtd/files/strEventScript-size.patch
Normal file
31
sys-apps/micro_evtd/files/strEventScript-size.patch
Normal file
@@ -0,0 +1,31 @@
|
||||
diff -Naur micro-evtd-3.3.3.orig/micro_evtd.c micro-evtd-3.3.3/micro_evtd.c
|
||||
--- micro-evtd-3.3.3.orig/micro_evtd.c 2009-03-15 11:41:36.011723240 -0700
|
||||
+++ micro-evtd-3.3.3/micro_evtd.c 2009-03-15 11:48:35.531745776 -0700
|
||||
@@ -400,10 +400,12 @@
|
||||
|
||||
static int execute_command2(char cmd, char* cmdstring, char type, char cmd2, long cmd3)
|
||||
{
|
||||
- char strEventScript[50];
|
||||
+ char strEventScript[256];
|
||||
+ int ret;
|
||||
|
||||
// Create the command line
|
||||
- sprintf(strEventScript, "/%s/micro_evtd.event %c %d %ld %s %s %d %c",
|
||||
+ ret = snprintf(strEventScript, 256,
|
||||
+ "/%s/micro_evtd.event %c %d %ld %s %s %d %c",
|
||||
(CP_SCRIPT == cmd? "usr/sbin" : strTmpPath),
|
||||
cmd,
|
||||
cmd2,
|
||||
@@ -411,6 +413,12 @@
|
||||
cmdstring,
|
||||
(CP_SCRIPT == cmd? strTmpPath : log_path),
|
||||
iDebugLevel, (CALL_NO_WAIT == type ? '&' : ' '));
|
||||
+
|
||||
+ // Check that string was not truncated
|
||||
+ if(ret >= 256) {
|
||||
+ syslog(LOG_ERR, "execute_command2(): command would overflow buffer");
|
||||
+ return -1;
|
||||
+ }
|
||||
|
||||
// Invoke request
|
||||
system(strEventScript);
|
||||
Reference in New Issue
Block a user