aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_worker.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-11-04 16:05:46 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-11-04 16:05:46 +0000
commit7d237da3934bec416fab604af74f61e8c53f0505 (patch)
tree67e6f07c6c3531b2a9fe318863c24e2bcec2608c /src/lua/lua_worker.c
parentcd60c1621b2f90aede6584a490aa2a8abf897980 (diff)
downloadrspamd-7d237da3934bec416fab604af74f61e8c53f0505.tar.gz
rspamd-7d237da3934bec416fab604af74f61e8c53f0505.zip
[Minor] Slightly improve logging in case of termination
Diffstat (limited to 'src/lua/lua_worker.c')
-rw-r--r--src/lua/lua_worker.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lua/lua_worker.c b/src/lua/lua_worker.c
index 940c6ae4a..4a3e4e908 100644
--- a/src/lua/lua_worker.c
+++ b/src/lua/lua_worker.c
@@ -841,7 +841,8 @@ lua_worker_spawn_process (lua_State *L)
/* Wait for parent to reply and exit */
rc = read (cbdata->sp[1], inbuf, sizeof (inbuf));
- if (memcmp (inbuf, "\0\0\0\0", 4) == 0) {
+ if (rc >= sizeof (inbuf) &&
+ memcmp (inbuf, "\0\0\0\0", sizeof (inbuf)) == 0) {
exit (EXIT_SUCCESS);
}
else {