Module: kamailio Branch: master Commit: 5a380e95b0914f9ae3b24ce9638404ad0b0afd6b URL: https://github.com/kamailio/kamailio/commit/5a380e95b0914f9ae3b24ce9638404ad...
Author: Federico Cabiddu federico.cabiddu@gmail.com Committer: GitHub noreply@github.com Date: 2019-09-08T10:17:13+02:00
Merge pull request #2058 from kamailio/grumvalski/dlg_check_xdata_len
dialog: check xdata length when loading profile from db
---
Modified: src/modules/dialog/dlg_db_handler.c
---
Diff: https://github.com/kamailio/kamailio/commit/5a380e95b0914f9ae3b24ce9638404ad... Patch: https://github.com/kamailio/kamailio/commit/5a380e95b0914f9ae3b24ce9638404ad...
---
diff --git a/src/modules/dialog/dlg_db_handler.c b/src/modules/dialog/dlg_db_handler.c index 2c89685ffc..56c7ef39a2 100644 --- a/src/modules/dialog/dlg_db_handler.c +++ b/src/modules/dialog/dlg_db_handler.c @@ -457,7 +457,7 @@ int load_dialog_info_from_db(int dlg_hash_size, int fetch_num_rows, dlg_set_toroute(dlg, &toroute_name);
GET_STR_VALUE(xdata, values, 21, 0, 0); - if(xdata.s!=NULL && dlg->state!=DLG_STATE_DELETED) + if(xdata.len > 0 && xdata.s!=NULL && dlg->state!=DLG_STATE_DELETED) { srjson_InitDoc(&jdoc, NULL); jdoc.buf = xdata;