diff --git a/modules/db_postgres/val.c b/modules/db_postgres/val.c index 142ce39a8c8..0f8d5e5f6da 100644 --- a/modules/db_postgres/val.c +++ b/modules/db_postgres/val.c @@ -123,6 +123,7 @@ int db_postgres_str2val(const db_type_t _t, db_val_t* _v, const char* _s, const case DB_STRING: LM_DBG("converting STRING [%s]\n", _s); VAL_STRING(_v) = _s; + VAL_STR(_v).len = _l; // Set the len field so that DB_STRING type could be used as DB_STR type when needed VAL_TYPE(_v) = DB_STRING; VAL_FREE(_v) = 1; return 0; diff --git a/modules/dialog/dlg_db_handler.c b/modules/dialog/dlg_db_handler.c index 72bf0bde41f..80877615c75 100644 --- a/modules/dialog/dlg_db_handler.c +++ b/modules/dialog/dlg_db_handler.c @@ -573,7 +573,7 @@ static int load_dialog_info_from_db(int dlg_hash_size) /* script variables */ if (!VAL_NULL(values+18)) read_dialog_vars( VAL_STR(values+18).s, - strlen(VAL_STR(values+18).s), dlg); + VAL_STR(values+18).len, dlg); /* profiles */ if (!VAL_NULL(values+19)) @@ -1378,7 +1378,7 @@ static int sync_dlg_db_mem(void) /* script variables */ if (!VAL_NULL(values+18)) read_dialog_vars( VAL_STR(values+18).s, - strlen(VAL_STR(values+18).s), dlg); + VAL_STR(values+18).len, dlg); /* profiles */ if (!VAL_NULL(values+19)) @@ -1536,7 +1536,7 @@ static int sync_dlg_db_mem(void) * and replace with new one */ if (!VAL_NULL(values+18)) read_dialog_vars( VAL_STR(values+18).s, - strlen(VAL_STR(values+18).s), known_dlg); + VAL_STR(values+18).len, known_dlg); /* skip flags - keep what we have - anyway can't tell which is new */ @@ -1615,7 +1615,7 @@ static int sync_dlg_db_mem(void) * and replace with new one */ if (!VAL_NULL(values+18)) read_dialog_vars( VAL_STR(values+18).s, - strlen(VAL_STR(values+18).s), known_dlg); + VAL_STR(values+18).len, known_dlg); /* profiles - do not insert into a profile * is dlg is already in that profile*/