diff --git a/debian/patches/series b/debian/patches/series index 85649720d..a8564a91f 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -4,6 +4,7 @@ # # upsream fixes from master upstream/pv-new-function-pv_evalx-dst-fmt.patch +upstream/presence-fix-crash-when-no-dialog.id-on-dialog-info-.patch # ## no_lib64_on_64_bits.patch diff --git a/debian/patches/upstream/presence-fix-crash-when-no-dialog.id-on-dialog-info-.patch b/debian/patches/upstream/presence-fix-crash-when-no-dialog.id-on-dialog-info-.patch new file mode 100644 index 000000000..febd1abdc --- /dev/null +++ b/debian/patches/upstream/presence-fix-crash-when-no-dialog.id-on-dialog-info-.patch @@ -0,0 +1,32 @@ +From: Victor Seva +Date: Fri, 23 Sep 2016 11:11:56 +0200 +Subject: presence: fix crash when no dialog.id on dialog-info xml + +Fix #794 +--- + modules/presence/presentity.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/modules/presence/presentity.c b/modules/presence/presentity.c +index b78f84a..629bda4 100644 +--- a/modules/presence/presentity.c ++++ b/modules/presence/presentity.c +@@ -686,13 +686,13 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body, + } + + check_if_dialog(*body, &is_dialog, &dialog_id); ++ if (is_dialog == 1) { ++ if (delete_presentity_if_dialog_id_exists(presentity, dialog_id) < 0) { ++ goto error; ++ } + +- if (delete_presentity_if_dialog_id_exists(presentity, dialog_id) < 0) { +- goto error; ++ free(dialog_id); + } +- +- free(dialog_id); +- + LM_DBG("inserting %d cols into table\n",n_query_cols); + + if (pa_dbf.insert(pa_db, query_cols, query_vals, n_query_cols) < 0)