<p>Joshua C. Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/10905">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Joshua C. Colp: Looks good to me, but someone else must approve; Approved for Submit
Sean Bright: Looks good to me, approved
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">pjproject_bundled: Add patch for double free issue in timer heap<br><br>Fixed #2172: Avoid double reference counter decrements in<br>timer in the scenario of race condition between<br>pj_timer_heap_cancel() and pj_timer_heap_poll().<br><br>Change-Id: If000e9438c83ac5084b678eb811e902c035bd2d8<br>---<br>A third-party/pjproject/patches/0020-Fixed-2172-Avoid-double-reference-counter-decrements.patch<br>1 file changed, 42 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/third-party/pjproject/patches/0020-Fixed-2172-Avoid-double-reference-counter-decrements.patch b/third-party/pjproject/patches/0020-Fixed-2172-Avoid-double-reference-counter-decrements.patch</span><br><span>new file mode 100644</span><br><span>index 0000000..e394506</span><br><span>--- /dev/null</span><br><span>+++ b/third-party/pjproject/patches/0020-Fixed-2172-Avoid-double-reference-counter-decrements.patch</span><br><span>@@ -0,0 +1,42 @@</span><br><span style="color: hsl(120, 100%, 40%);">+From 1fed39fe1488abd654a5488b5e6ad59b4b973331 Mon Sep 17 00:00:00 2001</span><br><span style="color: hsl(120, 100%, 40%);">+From: nanang <nanang@localhost></span><br><span style="color: hsl(120, 100%, 40%);">+Date: Tue, 8 Jan 2019 09:07:47 +0000</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: [PATCH 1/5] Fixed #2172: Avoid double reference counter decrements in</span><br><span style="color: hsl(120, 100%, 40%);">+ timer in the scenario of race condition between pj_timer_heap_cancel() and</span><br><span style="color: hsl(120, 100%, 40%);">+ pj_timer_heap_poll().</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+---</span><br><span style="color: hsl(120, 100%, 40%);">+ pjlib/src/pj/timer.c | 17 ++++++++++-------</span><br><span style="color: hsl(120, 100%, 40%);">+ 1 file changed, 10 insertions(+), 7 deletions(-)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+diff --git a/pjlib/src/pj/timer.c b/pjlib/src/pj/timer.c</span><br><span style="color: hsl(120, 100%, 40%);">+index 90a95e37b..7bae084ef 100644</span><br><span style="color: hsl(120, 100%, 40%);">+--- a/pjlib/src/pj/timer.c</span><br><span>++++ b/pjlib/src/pj/timer.c</span><br><span style="color: hsl(120, 100%, 40%);">+@@ -580,13 +580,16 @@ static int cancel_timer(pj_timer_heap_t *ht,</span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ lock_timer_heap(ht);</span><br><span style="color: hsl(120, 100%, 40%);">+ count = cancel(ht, entry, flags | F_DONT_CALL);</span><br><span style="color: hsl(120, 100%, 40%);">+- if (flags & F_SET_ID) {</span><br><span style="color: hsl(120, 100%, 40%);">+- entry->id = id_val;</span><br><span style="color: hsl(120, 100%, 40%);">+- }</span><br><span style="color: hsl(120, 100%, 40%);">+- if (entry->_grp_lock) {</span><br><span style="color: hsl(120, 100%, 40%);">+- pj_grp_lock_t *grp_lock = entry->_grp_lock;</span><br><span style="color: hsl(120, 100%, 40%);">+- entry->_grp_lock = NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+- pj_grp_lock_dec_ref(grp_lock);</span><br><span style="color: hsl(120, 100%, 40%);">++ if (count > 0) {</span><br><span style="color: hsl(120, 100%, 40%);">++ /* Timer entry found & cancelled */</span><br><span style="color: hsl(120, 100%, 40%);">++ if (flags & F_SET_ID) {</span><br><span style="color: hsl(120, 100%, 40%);">++ entry->id = id_val;</span><br><span style="color: hsl(120, 100%, 40%);">++ }</span><br><span style="color: hsl(120, 100%, 40%);">++ if (entry->_grp_lock) {</span><br><span style="color: hsl(120, 100%, 40%);">++ pj_grp_lock_t *grp_lock = entry->_grp_lock;</span><br><span style="color: hsl(120, 100%, 40%);">++ entry->_grp_lock = NULL;</span><br><span style="color: hsl(120, 100%, 40%);">++ pj_grp_lock_dec_ref(grp_lock);</span><br><span style="color: hsl(120, 100%, 40%);">++ }</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ unlock_timer_heap(ht);</span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+-- </span><br><span style="color: hsl(120, 100%, 40%);">+2.20.1</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/10905">change 10905</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/10905"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: If000e9438c83ac5084b678eb811e902c035bd2d8 </div>
<div style="display:none"> Gerrit-Change-Number: 10905 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation (1000185) </div>
<div style="display:none"> Gerrit-Reviewer: Joshua C. Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Sean Bright <sean.bright@gmail.com> </div>