From 97f9f8e909e2a80105de8b4dff651ae017f0afe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 21 Mar 2025 11:21:27 +0100 Subject: [PATCH] test/ca-fd-leak: fix clang-tidy lints (cherry picked from commit b050db951be9b94e1cce0341300bdae5ee4397a3) --- tests/nixos/ca-fd-leak/sender.c | 2 +- tests/nixos/ca-fd-leak/smuggler.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/nixos/ca-fd-leak/sender.c b/tests/nixos/ca-fd-leak/sender.c index 75e54fc8f..44d13c990 100644 --- a/tests/nixos/ca-fd-leak/sender.c +++ b/tests/nixos/ca-fd-leak/sender.c @@ -19,7 +19,7 @@ int main(int argc, char **argv) { struct sockaddr_un data; data.sun_family = AF_UNIX; data.sun_path[0] = 0; - strcpy(data.sun_path + 1, argv[1]); + strncpy(data.sun_path + 1, argv[1], sizeof(data.sun_path) - 2); // Now try to connect, To ensure we work no matter what order we are // executed in, just busyloop here. diff --git a/tests/nixos/ca-fd-leak/smuggler.c b/tests/nixos/ca-fd-leak/smuggler.c index 82acf37e6..ae6bd5371 100644 --- a/tests/nixos/ca-fd-leak/smuggler.c +++ b/tests/nixos/ca-fd-leak/smuggler.c @@ -5,6 +5,7 @@ #include #include #include +#include int main(int argc, char **argv) {