aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2005-10-27 19:38:39 +0000
committerBill Nottingham <notting@redhat.com>2005-10-27 19:38:39 +0000
commitaa7efcace1490586c24382eb2cf7e8928f0c9c40 (patch)
tree4a2a0d5d44742b997f8aaaad5b744780fb5fa749
parent3101a0f1cd6b57fff91412d99ae5d9445359984e (diff)
downloadinitscripts-aa7efcace1490586c24382eb2cf7e8928f0c9c40.tar
initscripts-aa7efcace1490586c24382eb2cf7e8928f0c9c40.tar.gz
initscripts-aa7efcace1490586c24382eb2cf7e8928f0c9c40.tar.bz2
initscripts-aa7efcace1490586c24382eb2cf7e8928f0c9c40.tar.xz
initscripts-aa7efcace1490586c24382eb2cf7e8928f0c9c40.zip
fix use-after-free (#171198)
-rw-r--r--src/initlog.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/initlog.c b/src/initlog.c
index 74f1a1f1..be98ebe0 100644
--- a/src/initlog.c
+++ b/src/initlog.c
@@ -215,7 +215,10 @@ int logLine(struct logInfo *logEnt) {
if ((stat(_PATH_LOG,&statbuf)==-1) || trySocket()) {
DDEBUG("starting daemon failed, pooling entry %d\n",logEntries);
logData=realloc(logData,(logEntries+1)*sizeof(struct logInfo));
- logData[logEntries]= (*logEnt);
+ logData[logEntries].fac = logEnt->fac;
+ logData[logEntries].pri = logEnt->pri;
+ logData[logEntries].cmd = strdup(logEnt->cmd);
+ logData[logEntries].line = strdup(logEnt->line);
logEntries++;
} else {
if (logEntries>0) {