代码拉取完成,页面将自动刷新
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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。