<p>Patch set 1:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/10194">View Change</a></p><p>2 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/10194/1/main/json.c">File main/json.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/10194/1/main/json.c@619">Patch Set #1, Line 619:</a> <code style="font-family:monospace,monospace">    return ast_json_pack("{s: s?, s: s?, s: o}",</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">As far as Asterisk is concerned the change is ok.</p><p style="white-space: pre-wrap; word-wrap: break-word;">However, this change is actually a step backwards because:</p><p style="white-space: pre-wrap; word-wrap: break-word;">There is a bug in the libjanson s? handling code.  The pack_string()->read_string() sets an error condition anyway for a NULL string even though it is supposed to be valid.</p><p style="white-space: pre-wrap; word-wrap: break-word;">This incorrectly set error condition then prevents subsequent error conditions from being reported.  Thus if context were NULL and exten had an invalid UTF-8 string we would not see the valid "invalid UTF-8" error message from exten but the erroneous NULL string error from context.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10194/1/main/json.c@750">Patch Set #1, Line 750:</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;">            "number", json_party_number(&party->number),<br>         "name", json_party_name(&party->name),<br>               "subaddress", json_party_subaddress(&party->subaddress));<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">You need to take into account the valid flag for the name, number, and subaddress.</p><p style="white-space: pre-wrap; word-wrap: break-word;">"number", party->number.valid ? json_party_number(&party->number) : NULL,</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/10194">change 10194</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/10194"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I8382d28d7d83ee0ce13334e51ae45dbc0bdaef48 </div>
<div style="display:none"> Gerrit-Change-Number: 10194 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.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>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 21 Sep 2018 17:52:11 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: Yes </div>