<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><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">As far as Asterisk is concerned the change is ok. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">It looks like this change causes a non-NULL return, apparently "s?" causes invalid UTF to become NULL which is then replaced by ast_json_null().</p><p style="white-space: pre-wrap; word-wrap: break-word;">That said ast_json_string_create() does not report errors, it returns NULL.  Further jansson-2.11 has a bug where ast_json_pack("{s: o}", "key", NULL) does not report an error (it does correctly return NULL though).  This jansson bug is fixed in the bundled copy by patch 0017.  Either way it's not currently possible to get an "invalid UTF-8" error message for an optional string.</p><p style="white-space: pre-wrap; word-wrap: break-word;">In any case I'll revert the changes to this function.</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><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">You need to take into account the valid flag for the name, number, and subaddress. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">json_party_number / json_party_name / json_party_address all return NULL if !valid so I think this is already covered.</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: 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 20:11:24 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: No </div>