diff --git a/debian/patches/series b/debian/patches/series index dc552f9c5..fdf2c3623 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -46,6 +46,7 @@ upstream/htable-remove-destroy-of-internal-structures-on-mod-.patch upstream/presence-remove-destroy-of-internal-structures-on-mo.patch upstream/pua-remove-destroy-of-internal-structures-on-mod-des.patch upstream/tm_drop_stuck_transaction.patch +upstream/pv_headers_add_more_guards_from_upstream.patch ### relevant for upstream sipwise/dialplan-don-t-stop-loading-rules-on-error.patch sipwise/kamctl-TMPDIR-config.patch @@ -68,6 +69,7 @@ sipwise/permissions_consider_db_mode_when_rpc_reload.patch sipwise/siputils_tel2sip_check_uri.patch sipwise/dialog_w_dlg_get_var_no_error_msg.patch sipwise/redis_dbase_no_error_msg.patch +sipwise/rtpengine_always_add_totag_to_ng_message_when_rtpp_flags.patch ### Don't just put stuff in any order ### use gbp pq import/export tooling to help maintain patches @@ -85,4 +87,4 @@ sipwise/redis_dbase_no_error_msg.patch ## git checkout -- debian/ ### git commit + git-review as usual ### -sipwise/rtpengine_always_add_totag_to_ng_message_when_rtpp_flags.patch + diff --git a/debian/patches/upstream/pv_headers_add_more_guards_from_upstream.patch b/debian/patches/upstream/pv_headers_add_more_guards_from_upstream.patch new file mode 100644 index 000000000..671637b13 --- /dev/null +++ b/debian/patches/upstream/pv_headers_add_more_guards_from_upstream.patch @@ -0,0 +1,53 @@ +--- a/src/modules/pv_headers/pvh_func.c ++++ b/src/modules/pv_headers/pvh_func.c +@@ -111,20 +111,20 @@ int pvh_collect_headers(struct sip_msg * + val_part.len = strlen(hvals[idx]); + if(pvh_set_xavi(msg, &_pvh_params.xavi_name, &name, &val_part, + SR_XTYPE_STR, 0, 1) +- < 0) ++ == NULL) + return -1; + } + continue; + } + if(pvh_set_xavi( + msg, &_pvh_params.xavi_name, &name, &val, SR_XTYPE_STR, 0, 1) +- < 0) ++ == NULL) + return -1; + } + + if(pvh_set_xavi(msg, &_pvh_params.xavi_helper_xname, &xavi_helper_name, + &_pvh_params.xavi_name, SR_XTYPE_STR, 0, 0) +- < 0) ++ == NULL) + return -1; + + pvh_hdrs_set_collected(msg); +--- a/src/modules/pv_headers/pvh_str.c ++++ b/src/modules/pv_headers/pvh_str.c +@@ -48,11 +48,12 @@ int pvh_str_free(str *s) + + int pvh_str_copy(str *dst, str *src, unsigned int max_size) + { +- unsigned int src_len = src->len + 1 >= max_size ? max_size - 1 : src->len; ++ unsigned int src_len = 0; + + if(src == NULL || dst == NULL || src->len <= 0) + return -1; + ++ src_len = src->len + 1 >= max_size ? max_size - 1 : src->len; + memset(dst->s, 0, dst->len); + memcpy(dst->s, src->s, src_len); + dst->s[src_len] = '\0'; +--- a/src/modules/pv_headers/pvh_xavp.c ++++ b/src/modules/pv_headers/pvh_xavp.c +@@ -518,7 +518,7 @@ int pvh_clone_branch_xavi(struct sip_msg + if(sub->val.type == SR_XTYPE_DATA) + continue; + if(pvh_xavi_append_value(&sub->name, &sub->val, &br_xavi->val.v.xavp) +- < 0) { ++ == NULL) { + LM_ERR("cannot clone xavi %.*s\n", sub->name.len, sub->name.s); + return -1; + }