1 From ec0c59a798ff1124295e7d5d82c2e30f1226cc07 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?=C3=89rico=20Nogueira?= <erico.erc@gmail.com>
3 Date: Fri, 29 Oct 2021 00:17:05 -0300
4 Subject: [PATCH] [core] fix switch_mprintf format string
6 Segfaults on 32-bit platforms running musl 1.2.x.
8 Reported-by: Sebastian Kemper <sebastian_ml@gmx.net>
10 src/switch_core_sqldb.c | 2 +-
11 1 file changed, 1 insertion(+), 1 deletion(-)
13 --- a/src/switch_core_sqldb.c
14 +++ b/src/switch_core_sqldb.c
15 @@ -3549,7 +3549,7 @@ SWITCH_DECLARE(switch_status_t) switch_c
17 sql = switch_mprintf("delete from registrations where hostname='%q'", switch_core_get_switchname());
19 - sql = switch_mprintf("delete from registrations where expires > 0 and expires <= %ld and hostname='%q'", now, switch_core_get_switchname());
20 + sql = switch_mprintf("delete from registrations where expires > 0 and expires <= %" TIME_T_FMT " and hostname='%q'", TIME_T_CAST(now), switch_core_get_switchname());
23 switch_sql_queue_manager_push(sql_manager.qm, sql, 0, SWITCH_FALSE);