Fix for Bug 1316: segfault from refclock_nmea
bk: 4abdc90cqensUNjmADEeQDe6RES7eQ
+* [Bug 1316] segfault if refclock_nmea can't open file.
(4.2.5p220) 2009/09/25 Released by Harlan Stenn <stenn@ntp.org>
* Rearrange libisc code to match the upstream layout in BIND. This is
step one of two, changing the layout but keeping our existing libisc.
* ln -s server:port /dev/gps1
*/
char buffer[80];
- char *nmea_host;
+ char *nmea_host, *nmea_tail;
int nmea_port;
int len;
struct hostent *he;
if ((nmea_host = strtok(buffer,":")) == NULL)
return(0);
+ if ((nmea_tail = strtok(NULL,":")) == NULL)
+ return(0);
- nmea_port = atoi(strtok(NULL,":"));
+ nmea_port = atoi(nmea_tail);
if ((he = gethostbyname(nmea_host)) == NULL)
return(0);