<p><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/18752">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-mgw/+/18752/8/src/libosmo-mgcp/mgcp_trunk.c">File src/libosmo-mgcp/mgcp_trunk.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-mgw/+/18752/8/src/libosmo-mgcp/mgcp_trunk.c@145">Patch Set #8, Line 145:</a> <code style="font-family:monospace,monospace">epname + prefix_len == str_trunk_nr_end</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">@pespin, are you sure this condition is correct? Is it checking whether endptr still is at the start of the string?</p><p style="white-space: pre-wrap; word-wrap: break-word;">The endptr logic in strtoul: it parses digits found at the start of the string (if any), and points endptr to after those digits. If I write "23potatoes" or "23 4 5 6" then strtoul() returns 23 and points at the rest of the string. However, usually those are invalid input strings and they should be rejected instead. So IIUC we should do:</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">  if (*endptr != '\0')<br>       error(invalid input string)</pre><p style="white-space: pre-wrap; word-wrap: break-word;">Or if some other delimiter character follows the trunk name, then that instead of '\0', right?</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-mgw/+/18752">change 18752</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-mgw/+/18752"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-mgw </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ifdaab953544151e73b58cc3e95d21afdb40765f4 </div>
<div style="display:none"> Gerrit-Change-Number: 18752 </div>
<div style="display:none"> Gerrit-PatchSet: 8 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-CC: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Mon, 29 Jun 2020 15:27:53 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Gerrit-MessageType: comment </div>