diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2005-07-29 04:23:45 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2005-07-29 04:23:45 +0000 |
commit | b928cb15077f4e5e83bd8f3312002e5cd7a21f45 (patch) | |
tree | 442ef7dc590f9ebf13f0298ada2c7d1c81db1814 | |
parent | 16b69641a6c842379324c991054b58c40670aa23 (diff) | |
download | gpsd-b928cb15077f4e5e83bd8f3312002e5cd7a21f45.tar.gz |
Prevent a core dump when we get a device assigned but don't know its type yet.
-rw-r--r-- | gpsd.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -631,7 +631,7 @@ static int handle_gpsd_request(int cfd, char *buf, int buflen) (void)snprintf(phrase, sizeof(phrase), ",M=%d", whoami->device->gpsdata.fix.mode); break; case 'N': - if (!assign_channel(whoami)) + if (!assign_channel(whoami) || whoami->device->device_type == NULL) (void)strcpy(phrase, ",N=?"); else if (!whoami->device->device_type->mode_switcher) (void)strcpy(phrase, ",N=0"); |