Change in osmo-mgw[master]: trunk: parse E1 trunk number

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

neels gerrit-no-reply at lists.osmocom.org
Mon Jun 29 15:27:53 UTC 2020


neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/18752 )

Change subject: trunk: parse E1 trunk number
......................................................................


Patch Set 8:

(1 comment)

https://gerrit.osmocom.org/c/osmo-mgw/+/18752/8/src/libosmo-mgcp/mgcp_trunk.c 
File src/libosmo-mgcp/mgcp_trunk.c:

https://gerrit.osmocom.org/c/osmo-mgw/+/18752/8/src/libosmo-mgcp/mgcp_trunk.c@145 
PS8, Line 145: epname + prefix_len == str_trunk_nr_end
@pespin, are you sure this condition is correct? Is it checking whether endptr still is at the start of the string?

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:

  if (*endptr != '\0')
       error(invalid input string)

Or if some other delimiter character follows the trunk name, then that instead of '\0', right?



-- 
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/18752
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: Ifdaab953544151e73b58cc3e95d21afdb40765f4
Gerrit-Change-Number: 18752
Gerrit-PatchSet: 8
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-CC: pespin <pespin at sysmocom.de>
Gerrit-Comment-Date: Mon, 29 Jun 2020 15:27:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200629/e8a6a291/attachment.htm>


More information about the gerrit-log mailing list