]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Plain lua bails about bad format strings and do abort
authorVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 15 Dec 2025 14:11:33 +0000 (14:11 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 15 Dec 2025 14:11:33 +0000 (14:11 +0000)
src/lua/lua_redis.c

index 02dccce2c24411adbe053e4bfaea37e0e9722c31..214f6433ed027866b1c162a029813c85a535e5f3 100644 (file)
@@ -762,7 +762,8 @@ lua_redis_timeout(EV_P_ ev_timer *w, int revents)
        REDIS_RETAIN(ctx);
        msg_debug_lua_redis("timeout while querying redis server: %p, redis: %p", sp_ud,
                                                sp_ud->common_ud->ctx);
-       lua_redis_push_error("timeout while connecting the server (%.2f sec)", ctx, sp_ud, TRUE, ud->timeout);
+       /* Note: lua_pushvfstring supports %f but not precision modifiers like %.2f */
+       lua_redis_push_error("timeout while connecting the server (%f sec)", ctx, sp_ud, TRUE, ud->timeout);
 
        if (sp_ud->common_ud->ctx) {
                ac = sp_ud->common_ud->ctx;