<p>Nickolay V. Shmyrev has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/14626">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_http_websocket: Add trailing zero for text strings<br><br>Per RFC example https://tools.ietf.org/html/rfc6455#section-5.7 text<br>message payload does not include trailing zero. Add trailing zero after<br>payload we received before we return string.<br><br>ASTERISK-28975 #close<br><br>Change-Id: Ib4a75cffeb1eb8cf01136ef30306bd623e531a2a<br>---<br>M res/res_http_websocket.c<br>1 file changed, 3 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/26/14626/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_http_websocket.c b/res/res_http_websocket.c</span><br><span>index 5d14ac6..1a2a850 100644</span><br><span>--- a/res/res_http_websocket.c</span><br><span>+++ b/res/res_http_websocket.c</span><br><span>@@ -1471,7 +1471,9 @@</span><br><span> return -1;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- ast_copy_string(*buf, payload, payload_len + 1);</span><br><span style="color: hsl(120, 100%, 40%);">+ memcpy(*buf, payload, payload_len);</span><br><span style="color: hsl(120, 100%, 40%);">+ (*buf)[payload_len] = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> return payload_len + 1;</span><br><span> }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/14626">change 14626</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/+/14626"/><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: Ib4a75cffeb1eb8cf01136ef30306bd623e531a2a </div>
<div style="display:none"> Gerrit-Change-Number: 14626 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Nickolay V. Shmyrev <nshmyrev@alphacephei.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>