Skip to content

Commit

Permalink
dialog: Do not crash with previous table version (11)
Browse files Browse the repository at this point in the history
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 a1b2738)
  • Loading branch information
liviuchircu committed Nov 19, 2024
1 parent ec8131a commit 356f75a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/dialog/dlg_db_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 356f75a

Please sign in to comment.