Module: kamailio
Branch: master
Commit: 5a380e95b0914f9ae3b24ce9638404ad0b0afd6b
URL:
https://github.com/kamailio/kamailio/commit/5a380e95b0914f9ae3b24ce9638404a…
Author: Federico Cabiddu <federico.cabiddu(a)gmail.com>
Committer: GitHub <noreply(a)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/5a380e95b0914f9ae3b24ce9638404a…
Patch:
https://github.com/kamailio/kamailio/commit/5a380e95b0914f9ae3b24ce9638404a…
---
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;