Patch Set 2:

(1 comment)
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

To view, visit
To unsubscribe, visit

Gerrit-MessageType: comment
Gerrit-Change-Id: Iee3e446b6689626516f01c521abe3d4603cd3e13
Gerrit-PatchSet: 2
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: dexter <>
Gerrit-Reviewer: Harald Welte <>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <>
Gerrit-Reviewer: Pau Espin Pedrol <>
Gerrit-Reviewer: Stefan Sperling <>
Gerrit-Reviewer: dexter <>
Gerrit-HasComments: Yes

Reply via email to