8 Star 0 Fork 39

src-openEuler/rsyslog

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
LICENSE
README.md
backport-Do-not-free-the-uninitialized-cstring.patch
backport-Fix-legacy-ActionQueueDiscardMark-parameter.patch
backport-Fix-passing-the-value-to-EscapeChar.patch
backport-Fix-runConf-NULL-pointer-refence.patch
backport-Keep-original-free-pattern.patch
backport-fix-memory-leak-in-omazureeventhubs-on-accepted-...
backport-fix-printing-of-time_t-values.patch
backport-network-subsystem-improve-connection-failure-err...
backport-nsd_ptcp-regression-fix-remove-debugging-message...
backport-omfile-do-not-carry-out-actual-action-when-writi...
backport-outchannel-eleminate-type-cast-for-compatibility...
backport-rainerscript-do-not-try-to-call-a-function-if-it...
bugfix-rsyslog-7.4.7-add-configuration-to-avoid-memory-le...
bugfix-rsyslog-7.4.7-imjournal-add-monotonic-timestamp.patch
os_check_timezone_for_rsyslog.sh
os_rotate_and_save_log.sh
print-main-queue-info-to-journal-when-queue-full.patch
print-main-queue-info-to-journal-when-receive-USR1-signal...
rsyslog-8.2312.0.tar.gz
rsyslog-8.24.0-ensure-parent-dir-exists-when-writting-log...
rsyslog-8.37.0-initialize-variables-and-check-return-valu...
rsyslog-doc-8.2312.0.tar.gz
rsyslog.conf
rsyslog.log
rsyslog.service
rsyslog.spec
rsyslog.sysconfig
rsyslog.yaml
timezone.cron
timezone_update.sh
tls-bugfix-parameter-StreamDriver_CRLFile-not-known.patch
克隆/下载
backport-rainerscript-do-not-try-to-call-a-function-if-it-doe.patch 1.47 KB
一键复制 编辑 原始数据 按行查看 历史
From 3ccbc99a1bf6b2da543c9db9ac03aca2019fc50f Mon Sep 17 00:00:00 2001
From: Cropi <alakatos@redhat.com>
Date: Wed, 25 Sep 2024 10:32:49 +0200
Subject: [PATCH] rainerscript: do not try to call a function if it does not
exist
---
grammar/rainerscript.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c
index 69d0b38ba..db7edbb1e 100644
--- a/grammar/rainerscript.c
+++ b/grammar/rainerscript.c
@@ -2901,11 +2901,6 @@ doFuncCall(struct cnffunc *__restrict__ const func, struct svar *__restrict__ co
free(fname);
}
if(func->fPtr == NULL) {
- char *fname = es_str2cstr(func->fname, NULL);
- LogError(0, RS_RET_INTERNAL_ERROR,
- "rainerscript: internal error: NULL pointer for function named '%s'\n",
- fname);
- free(fname);
ret->datatype = 'N';
ret->d.n = 0;
} else {
@@ -3802,7 +3797,7 @@ cnffuncDestruct(struct cnffunc *func)
char *cstr = es_str2cstr(func->fname, NULL);
struct scriptFunct *foundFunc = searchModList(cstr);
free(cstr);
- if(foundFunc->destruct != NULL) {
+ if(foundFunc && foundFunc->destruct != NULL) {
foundFunc->destruct(func);
}
@@ -5300,7 +5295,7 @@ cnffuncNew(es_str_t *fname, struct cnffparamlst* paramlst)
}
/* some functions require special initialization */
struct scriptFunct *foundFunc = searchModList(cstr);
- if(foundFunc->initFunc != NULL) {
+ if(foundFunc && foundFunc->initFunc != NULL) {
foundFunc->initFunc(func);
}
free(cstr);
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/rsyslog.git
git@gitee.com:src-openeuler/rsyslog.git
src-openeuler
rsyslog
rsyslog
master

搜索帮助