summaryrefslogtreecommitdiff
path: root/gpsd.c
diff options
context:
space:
mode:
authorReinhard Arlt <reinhard.arlt@t-online.de>2012-05-29 13:02:24 +0200
committerReinhard Arlt <reinhard.arlt@t-online.de>2012-05-29 13:02:24 +0200
commit9b62e28ceee2242e9f3b60ad684b79367a9d47f7 (patch)
tree5521fcb77410752febf7bb33a953f4529d89bff9 /gpsd.c
parent6a01d2e799b7d4078aedc55115b8bdc21e35d85e (diff)
parent7a14162fc42403473b5c1b24a4841bef066f3a39 (diff)
downloadgpsd-9b62e28ceee2242e9f3b60ad684b79367a9d47f7.tar.gz
Merge branch 'master' of git://git.sv.gnu.org/gpsd
Diffstat (limited to 'gpsd.c')
-rw-r--r--gpsd.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gpsd.c b/gpsd.c
index 7812f613..78229671 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -710,6 +710,13 @@ static bool add_device(const char *device_name)
{
struct gps_device_t *devp;
bool ret = false;
+ /* we can't handle paths longer than GPS_PATH_MAX, so don't try */
+ if (strlen(device_name) >= GPS_PATH_MAX) {
+ gpsd_report(LOG_ERROR,
+ "ignoring device %s: path length exceeds maximum %d\n",
+ device_name, GPS_PATH_MAX);
+ return false;
+ }
/* stash devicename away for probing when the first client connects */
for (devp = devices; devp < devices + MAXDEVICES; devp++)
if (!allocated_device(devp)) {