osmo-mgw[master]: client: use osmo_strlcpy instead of strncpy

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 Hofmeyr gerrit-no-reply at lists.osmocom.org
Fri Nov 24 12:18:03 UTC 2017


Patch Set 1:

(1 comment)

I see a number of other strcpy and strncpy instances around osmo-mgw.git. I think at some point I replaced all with osmo_strlcpy(), I wonder where all these are coming from now. Would you mind to replace all of the occurences in one fell swoop?

  src/libosmo-mgcp/mgcp_conn.c:107:	strcpy(conn->name, name);
  src/libosmo-mgcp/mgcp_network.c:91:		strncpy(addr, endp->cfg->net_ports.bind_addr, INET_ADDRSTRLEN);
  src/libosmo-mgcp/mgcp_network.c:99:		strncpy(addr, endp->cfg->source_addr, INET_ADDRSTRLEN);
  src/libosmo-mgcp-client/mgcp_client.c:204:	strncpy(r->audio_ip, line + 9, sizeof(r->audio_ip));
  src/libosmo-mgcp-client/mgcp_client.c:343:	strncpy(strbuf, (const char*)msg->data, l);
  tests/mgcp_client/mgcp_client_test.c:49:	strncpy(data, head, l);
  tests/mgcp_client/mgcp_client_test.c:56:	strncpy(data, params, l);
  tests/mgcp_client/mgcp_client_test.c:69:	strncpy(data, str, l);

https://gerrit.osmocom.org/#/c/5024/1//COMMIT_MSG
Commit Message:

Line 9: simplify null termination of the ip_addr string
(technically it's "nul termination", "null" refers to a NULL pointer. '\nul' is the string terminator. of course practically it's all just 0 anyway.)


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I94e3815f45d08e0d40faf41e580547de937c4ce8
Gerrit-PatchSet: 1
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-HasComments: Yes



More information about the gerrit-log mailing list