Explorar o código

dialog: check xdata length when loading profile from db

Federico Cabiddu %!s(int64=6) %!d(string=hai) anos
pai
achega
d05dfc2063
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/modules/dialog/dlg_db_handler.c

+ 1 - 1
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;