From 356f75adcf8ecfed0c4d15c3b285f24f3f922b3c Mon Sep 17 00:00:00 2001 From: Liviu Chircu Date: Tue, 19 Nov 2024 13:11:59 +0200 Subject: [PATCH] dialog: Do not crash with previous table version (11) This patch ensures OpenSIPS doesn't crash if the "dialog.script_flags" column is still of INT type (previous DB schema, before OpenSIPS 3.4). (cherry picked from commit a1b273828f3b20e1b99f9c8185d5a7bf78504d50) --- modules/dialog/dlg_db_handler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/dialog/dlg_db_handler.c b/modules/dialog/dlg_db_handler.c index 07f0b51f85c..33a9f2fd7a7 100644 --- a/modules/dialog/dlg_db_handler.c +++ b/modules/dialog/dlg_db_handler.c @@ -722,7 +722,7 @@ static int load_dialog_info_from_db(int dlg_hash_size) } /* script flags */ - if (!VAL_NULL(values+19)) { + if (!VAL_NULL(values+19) && VAL_TYPE(values+19) != DB_INT) { GET_STR_VALUE(flag_list, values, 19, 0, 0); dlg->user_flags = flag_list_to_bitmask(&flag_list, FLAG_TYPE_DIALOG, FLAG_DELIM, 1);