From 47581334df1117f67fb04b63b00d8283a496cdd8 Mon Sep 17 00:00:00 2001 From: SuiFei Date: Tue, 30 Sep 2025 22:00:25 +0800 Subject: [PATCH] fix: use safer snprintf to avoid format string vulnerability (CWE-134) --- usbctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usbctl.c b/usbctl.c index 1d5f4d7..d6c78ff 100644 --- a/usbctl.c +++ b/usbctl.c @@ -2130,7 +2130,7 @@ int install_systemd_service() "WantedBy=multi-user.target\n"; char service_file[1024]; - snprintf(service_file, sizeof(service_file), service_content, exe_path); + snprintf(service_file, sizeof(service_file), "%s", service_content); // Write service file FILE *fp = fopen("/etc/systemd/system/usbctl.service", "w");