From 1973f33305b6d6b21b97fcd90581075ba78722f4 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 3 Jan 2024 09:34:31 +0100 Subject: [PATCH] logger: make sure path is terminated [coverity scan] Signed-off-by: Karel Zak --- misc-utils/logger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc-utils/logger.c b/misc-utils/logger.c index 78103d21ec..e1d270de8d 100644 --- a/misc-utils/logger.c +++ b/misc-utils/logger.c @@ -248,7 +248,7 @@ static int unix_socket(struct logger_ctl *ctl, const char *path, int *socket_typ errx(EXIT_FAILURE, _("openlog %s: pathname too long"), path); s_addr.sun_family = AF_UNIX; - strncpy(s_addr.sun_path, path, sizeof(s_addr.sun_path)); + xstrncpy(s_addr.sun_path, path, sizeof(s_addr.sun_path)); for (i = 2; i; i--) { int st = -1; -- 2.47.3