osmo-mgw[master]: mgcp: make domain name configurable

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
Thu Jan 18 18:50:59 UTC 2018


Patch Set 1: Code-Review-1

(4 comments)

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

Line 1217: 	len = snprintf(buf, sizeof(buf),
snprintf() could return -1 here if the expanded string does not fit into buf.


Line 1220: 	rc = send_agent(cfg, buf, len);
Which means we could end up passing -1 as length here...

I suggest returning an error if snprintf() returns -1.


Line 1240: 	if (len < 0)
Here it is done correctly.


Line 1243: 	buf[sizeof(buf) - 1] = '\0';
Unrelated to your change, but this line is not needed with snprintf() and could be removed.

Adding a NUL manually is a common idiom after calling strncpy() because strncpy() does not always NUL-terminate the string. But snprintf() is fine.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia91ac428ba83ac1f9b52a0ec8dbf00ef7876da9e
Gerrit-PatchSet: 1
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Stefan Sperling <ssperling at sysmocom.de>
Gerrit-HasComments: Yes



More information about the gerrit-log mailing list