osmo-msc[master]: mcgp: let the MGW allocate the MGCP endpoint

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

Stefan Sperling gerrit-no-reply at lists.osmocom.org
Fri Feb 23 11:20:21 UTC 2018


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/#/c/6319/2/src/libmsc/msc_mgcp.c
File src/libmsc/msc_mgcp.c:

Line 252: 	    MGCP_ENDPOINT_MAXLEN) {
While this code is correct because sizeof(mgcp_msg.endpoint) and MGCP_ENDPOINT_MAXLEN have the same value, I would stick to the idiom:

  if (strlcpy(dst, src, dstsize) >= dstsize)

So I'd use the exact same value for the dstsize argument and the truncation check, either sizeof(mgcp_msg.endpoint) or MGCP_ENDPOINT_MAXLEN, but would avoid mixing them.

The reason is just that this is a common idiom people auditing code will be looking for. Not obviously using the same value raises a red flag in a reviewer's mind.

See also the EXAMPLES section in http://man.openbsd.org/strlcpy


-- 
To view, visit https://gerrit.osmocom.org/6319
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iee3e446b6689626516f01c521abe3d4603cd3e13
Gerrit-PatchSet: 2
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Stefan Sperling <ssperling at sysmocom.de>
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-HasComments: Yes



More information about the gerrit-log mailing list