From: Dave Hart Date: Sun, 12 Mar 2023 20:43:24 +0000 (-0400) Subject: [Bug 3801] gpsdjson refclock gps_open() device name mishandled. X-Git-Tag: NTP_4_2_8P16~30^2^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf704a2e44c3fb902bff06b4baf97bd7c5a03ec8;p=thirdparty%2Fntp.git [Bug 3801] gpsdjson refclock gps_open() device name mishandled. bk: 640e396cbVsjRcbk2kPQY1TCVc4FNw --- diff --git a/ChangeLog b/ChangeLog index 7aba47a78..36ef99eef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,5 @@ --- +* [Bug 3801] gpsdjson refclock gps_open() device name mishandled. * [Bug 3797] Windows getaddrinfo w/AI_ADDRCONFIG fails for localhost when disconnected, breaking ntpq and ntpdc. * [Bug 3795] pollskewlist documentation uses | when it shouldn't. @@ -6,7 +7,8 @@ * [Bug 3793] Wrong variable type passed to record_raw_stats(). - Report and patch by Yuezhen LUAN . * [Bug 3786] Timer starvation on high-load Windows ntpd. -* [Bug 3784] high-load ntpd on Windows deaf after enough ICMP TTL exceeded +* [Bug 3784] high-load ntpd on Windows deaf after enough ICMP TTL exceeded. + * [Bug 3781] log "Unable to listen for broadcasts" for IPv4 * [Bug 3774] mode 6 packets corrupted in rawstats file - Reported by Edward McGuire, fix identified by . diff --git a/ntpd/refclock_gpsdjson.c b/ntpd/refclock_gpsdjson.c index 354d89c0c..86d4c06d4 100644 --- a/ntpd/refclock_gpsdjson.c +++ b/ntpd/refclock_gpsdjson.c @@ -542,12 +542,15 @@ gpsd_start( up->logname); goto dev_fail; } + devname = up->device; up->device = ntp_realpath(devname); if (NULL == up->device) { msyslog(LOG_ERR, "%s: '%s' has no absolute path", up->logname, devname); goto dev_fail; } + free(devname); + devname = NULL; if (-1 == lstat(up->device, &sb)) { msyslog(LOG_ERR, "%s: '%s' not accessible", up->logname, up->device); @@ -558,8 +561,6 @@ gpsd_start( up->logname, up->device); goto dev_fail; } - free(devname); - devname = NULL; } else { /* All set up, just increment use count. */ ++up->refcount; diff --git a/ports/winnt/vs2015/ntpd/ntpd.vcxproj b/ports/winnt/vs2015/ntpd/ntpd.vcxproj index 32636048a..7f006af49 100644 --- a/ports/winnt/vs2015/ntpd/ntpd.vcxproj +++ b/ports/winnt/vs2015/ntpd/ntpd.vcxproj @@ -304,6 +304,7 @@ + @@ -516,4 +517,4 @@ - + \ No newline at end of file diff --git a/ports/winnt/vs2015/ntpd/ntpd.vcxproj.filters b/ports/winnt/vs2015/ntpd/ntpd.vcxproj.filters index 10bc14fcc..281bc462a 100644 --- a/ports/winnt/vs2015/ntpd/ntpd.vcxproj.filters +++ b/ports/winnt/vs2015/ntpd/ntpd.vcxproj.filters @@ -306,6 +306,9 @@ Source Files + + Reference Clock + @@ -562,4 +565,4 @@ - + \ No newline at end of file