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

login
register
mail settings
Submitter Colin King
Date Nov. 4, 2012, 10:19 p.m.
Message ID <1352067590-11820-9-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/197109/
State Rejected
Headers show

Comments

Colin King - Nov. 4, 2012, 10:19 p.m.
From: Colin Ian King <colin.king@canonical.com>

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

Patch

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);