[PATCH 08/12] lib: fwts_acpi_acpid: use strncpy instead of strcpy

Colin King colin.king at canonical.com
Sun Nov 4 22:19:46 UTC 2012


From: Colin Ian King <colin.king at canonical.com>

Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 src/lib/src/fwts_acpid.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/src/fwts_acpid.c b/src/lib/src/fwts_acpid.c
index c7e5c43..f394b54 100644
--- a/src/lib/src/fwts_acpid.c
+++ b/src/lib/src/fwts_acpid.c
@@ -53,7 +53,7 @@ int fwts_acpi_event_open(void)
 
         memset(&addr, 0, sizeof(addr));
         addr.sun_family = AF_UNIX;
-        strcpy(addr.sun_path, ACPID_SOCKET);
+        strncpy(addr.sun_path, ACPID_SOCKET, sizeof(addr.sun_path));
 
         if ((ret = connect(fd, (struct sockaddr *)&addr, sizeof(addr))) < 0) {
 		close(fd);
-- 
1.7.10.4




More information about the fwts-devel mailing list