Change in osmo-mgw[master]: protocol: reject illegal multiple lco options

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Wed Jun 6 12:21:40 UTC 2018


Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9474 )

Change subject: protocol: reject illegal multiple lco options
......................................................................


Patch Set 1:

(2 comments)

https://gerrit.osmocom.org/#/c/9474/1/src/libosmo-mgcp/mgcp_protocol.c
File src/libosmo-mgcp/mgcp_protocol.c:

https://gerrit.osmocom.org/#/c/9474/1/src/libosmo-mgcp/mgcp_protocol.c@406
PS1, Line 406: 	if (!ptr)
I don't understand this code, sorry.

* We first get a pointer to the [first] ":"
* we then enter the while loop, where we
** check if ptr <= options (which is not true, unless the ":" was the first character)
** we increment ptr, if *ptr is a space or a comma

But that increment could never happen, as we only ever enter the while loop with *ptr == ':'

What am I missing?

btw: these kind of side-effect free functions are the *ideal* candidates for unit tests inside the tests/ subdirectory.


https://gerrit.osmocom.org/#/c/9474/1/src/libosmo-mgcp/mgcp_protocol.c@428
PS1, Line 428: int check_local_cx_options(void *ctx, const char *options)
this function should have unit test coverage with a variety of legal and illegal strings as input.



-- 
To view, visit https://gerrit.osmocom.org/9474
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iae2fddfa5f2bcfc952f8ab217b3056694e5f7812
Gerrit-Change-Number: 9474
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: Harald Welte <laforge at gnumonks.org>
Gerrit-Comment-Date: Wed, 06 Jun 2018 12:21:40 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180606/70ce6b8c/attachment.htm>


More information about the gerrit-log mailing list