Module: kamailio
Branch: 5.2
Commit: 761758b1d8a7ebdb72caf8d5442a38988cf2e951
URL:
https://github.com/kamailio/kamailio/commit/761758b1d8a7ebdb72caf8d5442a389…
Author: Federico Cabiddu <federico.cabiddu(a)gmail.com>
Committer: Federico Cabiddu <federico.cabiddu(a)gmail.com>
Date: 2019-09-08T10:20:56+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/761758b1d8a7ebdb72caf8d5442a389…
Patch:
https://github.com/kamailio/kamailio/commit/761758b1d8a7ebdb72caf8d5442a389…
---
diff --git a/src/modules/dialog/dlg_db_handler.c b/src/modules/dialog/dlg_db_handler.c
index 1b9d704cf6..b15cc86485 100644
--- a/src/modules/dialog/dlg_db_handler.c
+++ b/src/modules/dialog/dlg_db_handler.c
@@ -452,7 +452,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;