Module: kamailio
Branch: 5.1
Commit: 75dc482cf327e3a707281f903c7e75d3b28cf52c
URL:
https://github.com/kamailio/kamailio/commit/75dc482cf327e3a707281f903c7e75d…
Author: Federico Cabiddu <federico.cabiddu(a)gmail.com>
Committer: Federico Cabiddu <federico.cabiddu(a)gmail.com>
Date: 2019-09-08T10:20:36+02:00
dialog: check xdata length when loading profile from db
(cherry picked from commit d05dfc20632fde1d65017ff5d7f41713a9c79825)
---
Modified: src/modules/dialog/dlg_db_handler.c
---
Diff:
https://github.com/kamailio/kamailio/commit/75dc482cf327e3a707281f903c7e75d…
Patch:
https://github.com/kamailio/kamailio/commit/75dc482cf327e3a707281f903c7e75d…
---
diff --git a/src/modules/dialog/dlg_db_handler.c b/src/modules/dialog/dlg_db_handler.c
index 8e8b5b088b..92d469852e 100644
--- a/src/modules/dialog/dlg_db_handler.c
+++ b/src/modules/dialog/dlg_db_handler.c
@@ -414,7 +414,7 @@ static 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;