summaryrefslogtreecommitdiff
path: root/serial
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2009-06-30 15:48:53 +0300
committerJohan Hedberg <johan.hedberg@nokia.com>2009-06-30 15:48:53 +0300
commitcd6e797fdeed645cefa4f05c46eefd94c204e91b (patch)
tree66b63e3d68ec5a55b8236af33d07d0ea5e0a9334 /serial
parentee5e34075588e3a9a375c66fcfc63aae9e770165 (diff)
Use (safer) strncpy instead of strcpy
Diffstat (limited to 'serial')
-rw-r--r--serial/proxy.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/serial/proxy.c b/serial/proxy.c
index b188ff031..c0a4b162c 100644
--- a/serial/proxy.c
+++ b/serial/proxy.c
@@ -307,10 +307,11 @@ static inline int unix_socket_connect(const char *address)
* Abstract namespace: first byte NULL, x00
* must be removed from the original address.
*/
- strcpy(addr.sun_path + 1, address + 3);
+ strncpy(addr.sun_path + 1, address + 3,
+ sizeof(addr.sun_path) - 2);
} else {
/* Filesystem address */
- strcpy(addr.sun_path, address);
+ strncpy(addr.sun_path, address, sizeof(addr.sun_path) - 1);
}
/* Unix socket */