<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/6455">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Joshua Colp: Looks good to me, but someone else must approve; Approved for Submit
  Kevin Harwell: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">chan_sip: when getting sip pvt return failure if not found<br><br>In handle_request_invite, when processing a pickup, a call<br>is made to get_sip_pvt_from_replaces to locate the pvt for<br>the subscription. The pvt is assumed to be valid when zero<br>is returned indicating no error, and is dereferenced which<br>can cause a crash if it was not found.<br><br>This change checks the not found case and returns -1 which<br>allows the calling code to fail appropriately.<br><br>ASTERISK-27217 #close<br>Reported-by: Bryan Walters<br><br>Change-Id: I6bee92b8b8b85fcac3fd66f8c00ab18bc1765612<br>---<br>M channels/chan_sip.c<br>1 file changed, 5 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/channels/chan_sip.c b/channels/chan_sip.c<br>index b19c669..e862e9d 100644<br>--- a/channels/chan_sip.c<br>+++ b/channels/chan_sip.c<br>@@ -18568,6 +18568,11 @@<br>             }<br>     }<br> <br>+ if (!sip_pvt_ptr) {<br>+          /* return error if sip_pvt was not found */<br>+          return -1;<br>+   }<br>+<br>  /* If we're here sip_pvt_ptr has been copied to *out_pvt, prevent RAII_VAR cleanup */<br>     sip_pvt_ptr = NULL;<br> <br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6455">change 6455</a>. To unsubscribe, 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/6455"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I6bee92b8b8b85fcac3fd66f8c00ab18bc1765612 </div>
<div style="display:none"> Gerrit-Change-Number: 6455 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Scott Griepentrog <scott@griepentrog.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>