diff options
author | Marti Bolivar <mbolivar@leaflabs.com> | 2012-05-24 18:49:17 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2012-05-29 05:01:33 -0400 |
commit | 0a0f49b6b89049bac374c839f069132d025fc1e7 (patch) | |
tree | 3a4e27bb0a82cdd825cdec6311c4aafd695ebcf6 /gpsd.c | |
parent | 5b146d26118d659a3373b4c76cdd89f48971e367 (diff) | |
download | gpsd-0a0f49b6b89049bac374c839f069132d025fc1e7.tar.gz |
Don't try to add devices with long paths.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
Diffstat (limited to 'gpsd.c')
-rw-r--r-- | gpsd.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -707,6 +707,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)) { |