Harald Welte has submitted this change and it was merged. (
https://gerrit.osmocom.org/10175 )
Change subject: fix strncpy bugs in socket.c
......................................................................
fix strncpy bugs in socket.c
Change-Id: Iddf36d26b23dcef4f9b291fd7ead1907e38c3486
---
M src/socket.c
1 file changed, 1 insertion(+), 2 deletions(-)
Approvals:
Harald Welte: Looks good to me, approved
Pau Espin Pedrol: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/socket.c b/src/socket.c
index 0405847..dc5590c 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -596,8 +596,7 @@
return -EINVAL;
local.sun_family = AF_UNIX;
- strncpy(local.sun_path, socket_path, sizeof(local.sun_path));
- local.sun_path[sizeof(local.sun_path) - 1] = '\0';
+ osmo_strlcpy(local.sun_path, socket_path, sizeof(local.sun_path));
#if defined(BSD44SOCKETS) || defined(__UNIXWARE__)
local.sun_len = strlen(local.sun_path);
--
To view, visit https://gerrit.osmocom.org/10175
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Iddf36d26b23dcef4f9b291fd7ead1907e38c3486
Gerrit-Change-Number: 10175
Gerrit-PatchSet: 4
Gerrit-Owner: Neels Hofmeyr <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol <[email protected]>