diff options
author | Reinhard Arlt <reinhard.arlt@t-online.de> | 2012-05-29 13:02:24 +0200 |
---|---|---|
committer | Reinhard Arlt <reinhard.arlt@t-online.de> | 2012-05-29 13:02:24 +0200 |
commit | 9b62e28ceee2242e9f3b60ad684b79367a9d47f7 (patch) | |
tree | 5521fcb77410752febf7bb33a953f4529d89bff9 /gpsd.c | |
parent | 6a01d2e799b7d4078aedc55115b8bdc21e35d85e (diff) | |
parent | 7a14162fc42403473b5c1b24a4841bef066f3a39 (diff) | |
download | gpsd-9b62e28ceee2242e9f3b60ad684b79367a9d47f7.tar.gz |
Merge branch 'master' of git://git.sv.gnu.org/gpsd
Diffstat (limited to 'gpsd.c')
-rw-r--r-- | gpsd.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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)) { |