<p><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/17394">View Change</a></p><p>1 comment:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/17394/3/src/csn1.c">File src/csn1.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.osmocom.org/c/osmo-pcu/+/17394/3/src/csn1.c@1465">Patch Set #3, Line 1465:</a> <code style="font-family:monospace,monospace"></code></p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">... at the start we know we hit an error (negative number of bites) or we simply reached the end, so we are done.</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">The problem is that we don't know in advance (i.e. without entering the loop) whether it's an error or not. As you have probably seen, some CSN.1 definitions have names like 'M_*_OR_NULL' which means that they're basically optional and can be omitted. The encoder would simply return 0 if pDescr points to an optional field or a ProcessError(...) otherwise.</p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">This patch doesn't look good to me.</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">I am now thinking about removing this check from csnStreamDecoder() too.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-pcu/+/17394">change 17394</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.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.osmocom.org/c/osmo-pcu/+/17394"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-pcu </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ie3a15e210624599e39b1e70c8d34efc10c552f6c </div>
<div style="display:none"> Gerrit-Change-Number: 17394 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Sat, 07 Mar 2020 08:31:41 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Comment-In-Reply-To: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>