<p>Scott Griepentrog has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/6452">View Change</a></p><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;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/52/6452/1</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 beaa3de..f6ca3c7 100644<br>--- a/channels/chan_sip.c<br>+++ b/channels/chan_sip.c<br>@@ -18625,6 +18625,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/6452">change 6452</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/6452"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I6bee92b8b8b85fcac3fd66f8c00ab18bc1765612 </div>
<div style="display:none"> Gerrit-Change-Number: 6452 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Scott Griepentrog <scott@griepentrog.com> </div>