[PATCH] libosmo-abis[master]: unixsocket: fix a potential string overflow

lynxis lazus gerrit-no-reply at lists.osmocom.org
Wed Oct 11 05:07:04 UTC 2017

Review at  https://gerrit.osmocom.org/4213

unixsocket: fix a potential string overflow

Change-Id: I8e3ec741247d728232f8c07c94eb63f068597d80
Found-by: coverity
M src/input/unixsocket.c
1 file changed, 1 insertion(+), 1 deletion(-)

  git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/13/4213/1

diff --git a/src/input/unixsocket.c b/src/input/unixsocket.c
index 63bd796..06841d3 100644
--- a/src/input/unixsocket.c
+++ b/src/input/unixsocket.c
@@ -232,7 +232,7 @@
 	int i;
 	if (line->sock_path)
-		strcpy(sock_path, line->sock_path);
+		strncpy(sock_path, line->sock_path, PATH_MAX - 1);
 		sprintf(sock_path, "%s%d", UNIXSOCKET_SOCK_PATH_DEFAULT,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8e3ec741247d728232f8c07c94eb63f068597d80
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>

More information about the gerrit-log mailing list