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

Submitted by Colin King on Nov. 4, 2012, 10:19 p.m.

Details

Message ID 1352067590-11820-9-git-send-email-colin.king@canonical.com
State Rejected
Headers show

Commit Message

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 hide | download patch | download mbox

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