[sr-dev] git:5.1:75dc482c: dialog: check xdata length when loading profile from db

Federico Cabiddu federico.cabiddu at gmail.com
Sun Sep 8 10:20:48 CEST 2019


Module: kamailio
Branch: 5.1
Commit: 75dc482cf327e3a707281f903c7e75d3b28cf52c
URL: https://github.com/kamailio/kamailio/commit/75dc482cf327e3a707281f903c7e75d3b28cf52c

Author: Federico Cabiddu <federico.cabiddu at gmail.com>
Committer: Federico Cabiddu <federico.cabiddu at 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/75dc482cf327e3a707281f903c7e75d3b28cf52c.diff
Patch: https://github.com/kamailio/kamailio/commit/75dc482cf327e3a707281f903c7e75d3b28cf52c.patch

---

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;




More information about the sr-dev mailing list