<p> Attention is currently required from: N A, Richard Mudgett. </p>
<p>Patch set 6:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4; color: #000000;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/16231">View Change</a></p><p>2 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="null">File funcs/func_scramble.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/16231/comment/904a2c7b_de09eab6">Patch Set #6, Line 195:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">      ast_channel_lock(chan);<br>       if (!(datastore = ast_channel_datastore_find(chan, &scramble_datastore, NULL))) {<br>         ast_channel_unlock(chan);<br>             /* Allocate a new datastore to hold the reference to this audiohook information */<br>            if (!(datastore = ast_datastore_alloc(&scramble_datastore, NULL))) {<br>                      return 0;<br>             }<br>             if (!(ni = ast_calloc(1, sizeof(*ni)))) {<br>                     ast_datastore_free(datastore);<br>                        return 0;<br>             }<br>             ast_audiohook_init(&ni->audiohook, AST_AUDIOHOOK_TYPE_MANIPULATE, "Voice scrambler", AST_AUDIOHOOK_MANIPULATE_ALL_RATES);<br>            ni->audiohook.manipulate_callback = scramble_callback;<br>             datastore->data = ni;<br>              ast_channel_lock(chan);<br>               ast_channel_datastore_add(chan, datastore);<br>           ast_audiohook_attach(chan, &ni->audiohook);<br>    } else {<br>              ni = datastore->data;<br>      }<br>     ast_channel_unlock(chan);<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Leave the lock/unlock calls surrounding the "if" but remove the ones embedded within. As it is now there is still a chance for two datastores on the same channel to be created.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/16231/comment/394fdd08_1fe1bcdf">Patch Set #6, Line 216:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;"> ni->tx = tx;<br>       ni->rx = rx;<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Surround setting these variables too in the lock above otherwise two separate threads could attempt to modify them at the same time.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/16231">change 16231</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/c/asterisk/+/16231"/><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-Change-Id: I01020769d91060a1f56a708eb405f87648d1a67e </div>
<div style="display:none"> Gerrit-Change-Number: 16231 </div>
<div style="display:none"> Gerrit-PatchSet: 6 </div>
<div style="display:none"> Gerrit-Owner: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Attention: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-Attention: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 10 Aug 2021 21:47:29 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: Yes </div>
<div style="display:none"> Gerrit-MessageType: comment </div>