]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 3801] gpsdjson refclock gps_open() device name mishandled.
authorDave Hart <hart@ntp.org>
Sun, 12 Mar 2023 20:43:24 +0000 (16:43 -0400)
committerDave Hart <hart@ntp.org>
Sun, 12 Mar 2023 20:43:24 +0000 (16:43 -0400)
bk: 640e396cbVsjRcbk2kPQY1TCVc4FNw

ChangeLog
ntpd/refclock_gpsdjson.c
ports/winnt/vs2015/ntpd/ntpd.vcxproj
ports/winnt/vs2015/ntpd/ntpd.vcxproj.filters

index 7aba47a788285eda9251fae285c76cc9eaa39aa0..36ef99eef76078492f129b718a25c9cbdf0b7804 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,5 @@
 ---
+* [Bug 3801] gpsdjson refclock gps_open() device name mishandled. <hart@ntp.org>
 * [Bug 3797] Windows getaddrinfo w/AI_ADDRCONFIG fails for localhost when 
              disconnected, breaking ntpq and ntpdc. <hart@ntp.org>
 * [Bug 3795] pollskewlist documentation uses | when it shouldn't.
@@ -6,7 +7,8 @@
 * [Bug 3793] Wrong variable type passed to record_raw_stats(). <hart@ntp.org>
   - Report and patch by Yuezhen LUAN <wei6410@sina.com>.
 * [Bug 3786] Timer starvation on high-load Windows ntpd. <hart@ntp.org>
-* [Bug 3784] high-load ntpd on Windows deaf after enough ICMP TTL exceeded <hart@ntp.org>
+* [Bug 3784] high-load ntpd on Windows deaf after enough ICMP TTL exceeded.
+             <hart@ntp.org>
 * [Bug 3781] log "Unable to listen for broadcasts" for IPv4 <hart@ntp.org>
 * [Bug 3774] mode 6 packets corrupted in rawstats file <hart@ntp.org>
   - Reported by Edward McGuire, fix identified by <wei6410@sina.com>.
index 354d89c0c467009392e0d56f9d6afe35759821fc..86d4c06d4d00a8c1052a11fd59c101267898ac1d 100644 (file)
@@ -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;
index 32636048aef0f7fe13d56387c10301557b696c62..7f006af49ea0750a45c7036407d253751877c677 100644 (file)
     <ClCompile Include="..\..\..\..\ntpd\refclock_datum.c" />
     <ClCompile Include="..\..\..\..\ntpd\refclock_dumbclock.c" />
     <ClCompile Include="..\..\..\..\ntpd\refclock_fg.c" />
+    <ClCompile Include="..\..\..\..\ntpd\refclock_gpsdjson.c" />
     <ClCompile Include="..\..\..\..\ntpd\refclock_gpsvme.c" />
     <ClCompile Include="..\..\..\..\ntpd\refclock_heath.c" />
     <ClCompile Include="..\..\..\..\ntpd\refclock_hopfpci.c" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
+</Project>
\ No newline at end of file
index 10bc14fcc7d74ac477f53ddb9efe5117492e21e0..281bc462a986e2135407e4b9e3dae6930229d4d0 100644 (file)
     <ClCompile Include="..\..\ntpd\nt_ppsimpl.c">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\..\..\ntpd\refclock_gpsdjson.c">
+      <Filter>Reference Clock</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\..\..\include\ascii.h">
     </CustomBuild>
     <CustomBuild Include="..\..\..\..\packageinfo.sh" />
   </ItemGroup>
-</Project>
+</Project>
\ No newline at end of file