From cac87558fd78304eb9439ea77a44a8fa7a2a9dde Mon Sep 17 00:00:00 2001 From: smitsohu Date: Wed, 17 Jul 2019 18:54:51 +0200 Subject: faudit: fix gcc stringop-truncation warning --- src/faudit/dbus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/faudit') diff --git a/src/faudit/dbus.c b/src/faudit/dbus.c index 2971ea55b..2e4a7550b 100644 --- a/src/faudit/dbus.c +++ b/src/faudit/dbus.c @@ -35,7 +35,7 @@ int check_unix(const char *sockfile) { struct sockaddr_un remote; memset(&remote, 0, sizeof(struct sockaddr_un)); remote.sun_family = AF_UNIX; - strncpy(remote.sun_path, sockfile, sizeof(remote.sun_path)); + strncpy(remote.sun_path, sockfile, sizeof(remote.sun_path) - 1); int len = strlen(remote.sun_path) + sizeof(remote.sun_family); if (*sockfile == '@') remote.sun_path[0] = '\0'; -- cgit v1.2.3-54-g00ecf