Module: kamailio
Branch: master
Commit: d05dfc20632fde1d65017ff5d7f41713a9c79825
URL: 
https://github.com/kamailio/kamailio/commit/d05dfc20632fde1d65017ff5d7f41713a9c79825

Author: Federico Cabiddu <federico.cabi...@gmail.com>
Committer: Federico Cabiddu <federico.cabi...@gmail.com>
Date: 2019-09-08T09:01:10+02:00

dialog: check xdata length when loading profile from db

---

Modified: src/modules/dialog/dlg_db_handler.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/d05dfc20632fde1d65017ff5d7f41713a9c79825.diff
Patch: 
https://github.com/kamailio/kamailio/commit/d05dfc20632fde1d65017ff5d7f41713a9c79825.patch

---

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;


_______________________________________________
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to