Module: sip-router Branch: master Commit: ae76e2183c9966cfe44c0519de7d5a53be08041c URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ae76e218...
Author: Timo Reimann sr@foo-lounge.de Committer: Timo Reimann sr@foo-lounge.de Date: Sun Nov 6 02:21:08 2011 +0100
dialog(k): When restoring dialog variables from database calculate and set variable string length.
- Fixes Flyspray #172.
---
modules_k/dialog/dlg_db_handler.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/modules_k/dialog/dlg_db_handler.c b/modules_k/dialog/dlg_db_handler.c index a9b38ef..5e0a7a0 100644 --- a/modules_k/dialog/dlg_db_handler.c +++ b/modules_k/dialog/dlg_db_handler.c @@ -526,7 +526,9 @@ static int load_dialog_vars_from_db(int fetch_num_rows) dlg = (d_table->entries)[VAL_INT(values)].first; while (dlg) { if (dlg->h_id == VAL_INT(values+1)) { - set_dlg_variable_unsafe(dlg, &VAL_STR(values+2), &VAL_STR(values+3)); + str key = { VAL_STR(values+2).s, strlen(VAL_STRING(values+2)) }; + str value = { VAL_STR(values+3).s, strlen(VAL_STRING(values+3)) }; + set_dlg_variable_unsafe(dlg, &key, &value); break; } dlg = dlg->next;