c8e4b4c71cc5805948f773c860a259100bc405d2
[feed/telephony.git] / libs / pjproject / patches / 0070-fix-incorrect-copying-when-creating-cancel.patch
1 From ce18018cc17bef8f80c08686e3a7b28384ef3ba5 Mon Sep 17 00:00:00 2001
2 From: sauwming <ming@teluu.com>
3 Date: Mon, 12 Oct 2020 13:31:25 +0800
4 Subject: [PATCH] Fix incorrect copying of destination info when creating
5 CANCEL (#2546)
6
7 ---
8 pjsip/src/pjsip/sip_util.c | 10 +++++-----
9 1 file changed, 5 insertions(+), 5 deletions(-)
10
11 --- a/pjsip/src/pjsip/sip_util.c
12 +++ b/pjsip/src/pjsip/sip_util.c
13 @@ -779,14 +779,14 @@ PJ_DEF(pj_status_t) pjsip_endpt_create_c
14 pjsip_hdr_clone(cancel_tdata->pool, req_tdata->saved_strict_route);
15 }
16
17 - /* Copy the destination host name from the original request */
18 - pj_strdup(cancel_tdata->pool, &cancel_tdata->dest_info.name,
19 - &req_tdata->dest_info.name);
20 -
21 - /* Finally copy the destination info from the original request */
22 + /* Copy the destination info from the original request */
23 pj_memcpy(&cancel_tdata->dest_info, &req_tdata->dest_info,
24 sizeof(req_tdata->dest_info));
25
26 + /* Finally, copy the destination host name from the original request */
27 + pj_strdup(cancel_tdata->pool, &cancel_tdata->dest_info.name,
28 + &req_tdata->dest_info.name);
29 +
30 /* Done.
31 * Return the transmit buffer containing the CANCEL request.
32 */