commit b1b7c1f: [Minor] Lua_task: Fix error handling for a task with no message

Vsevolod Stakhov vsevolod at highsecure.ru
Sun Dec 8 09:42:06 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-12-08 09:39:59 +0000
URL: https://github.com/rspamd/rspamd/commit/b1b7c1f7fc99783236188645d39f2497559e1cf8 (HEAD -> master)

[Minor] Lua_task: Fix error handling for a task with no message

---
 src/lua/lua_task.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index 2354cb546..7072ebe35 100644
--- a/src/lua/lua_task.c
+++ b/src/lua/lua_task.c
@@ -2860,7 +2860,13 @@ lua_task_get_received_headers (lua_State * L)
 	const gchar *proto;
 	guint k = 1;
 
-	if (task && task->message) {
+	if (task) {
+		if (!task->message) {
+			/* No message - no received */
+			lua_newtable (L);
+			return 1;
+		}
+
 		if (!lua_task_get_cached (L, task, "received")) {
 			lua_createtable (L, 0, 0);
 


More information about the Commits mailing list