summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2012-05-10 22:57:40 -0400
committerEric S. Raymond <esr@thyrsus.com>2012-05-10 22:57:40 -0400
commitf1c0e01168c12c8cdc5e3e60df0edc8012f86cd4 (patch)
tree2420e7fe558506bb0451e762efbc2e5980c18b23
parenta940dde5dfe8882031aeef84634213fd2ad7ca94 (diff)
downloadgpsd-f1c0e01168c12c8cdc5e3e60df0edc8012f86cd4.tar.gz
Avoid overrunning an NMEA2000 device name buffer. Coverity defect #12.
-rw-r--r--libgpsd_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libgpsd_core.c b/libgpsd_core.c
index 84a59735..7beb0b7b 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -330,7 +330,7 @@ int gpsd_open(struct gps_device_t *session)
(void)strlcpy(interface_name, session->gpsdata.dev.path + 11, sizeof(interface_name));
/* Locate the interface you wish to use */
- strcpy(ifr.ifr_name, interface_name);
+ strlcpy(ifr.ifr_name, interface_name, sizeof(ifr.ifr_name));
status = ioctl(sock, SIOCGIFINDEX, &ifr); /* ifr.ifr_ifindex gets filled
* with that device's index */