[Git][NTPsec/ntpsec][master] 2 commits: Fixes strlcpy warning from refclock_gpsd on OSX and FreeBSD.

Matt Selsky gitlab at mg.gitlab.com
Sun Sep 22 18:18:56 UTC 2019



Matt Selsky pushed to branch master at NTPsec / ntpsec


Commits:
5363c325 by Fred Wright at 2019-09-22T04:18:26Z
Fixes strlcpy warning from refclock_gpsd on OSX and FreeBSD.

According to the (now removed) comment, defining _XOPEN_SOURCE was
necessary to get the prototype for strptime(), but empirically this is
not the case, and removing the definition fixes strlcpy().

TESTED:
Warning is now gone on FreeBSD 10.3 and OSX 10.13.  Still no warnings
on Ubuntu 14.04, CentOS 7, and Fedora 25.

- - - - -
90b71eda by Fred Wright at 2019-09-22T04:18:26Z
Fixes format warning from ntp_control on OSX.

This just needed the obvious fix to the cast.  It's not clear why it
wasn't complaining on other platforms.

TESTED:
Warning is now gone on FreeBSD 10.3 and OSX 10.13.  Still no warnings
on Ubuntu 14.04, CentOS 7, and Fedora 25.

- - - - -


2 changed files:

- ntpd/ntp_control.c
- ntpd/refclock_gpsd.c


Changes:

=====================================
ntpd/ntp_control.c
=====================================
@@ -2609,7 +2609,7 @@ ctl_getitem(
 		    msyslog(LOG_WARNING,
 			    "Possible 'ntpdx' exploit from %s#%" PRIu16
                             " (possibly spoofed)",
-			    socktoa(rmt_addr), (unsigned)SRCPORT(rmt_addr));
+			    socktoa(rmt_addr), (uint16_t)SRCPORT(rmt_addr));
 	    }
 	reqpt = reqend; /* never again for this packet! */
 	return NULL;


=====================================
ntpd/refclock_gpsd.c
=====================================
@@ -60,12 +60,6 @@
  */
 
 
-/* The strptime prototype is not provided unless explicitly requested.
- * See the POSIX spec for more info:
- * http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_02_01_02
- */
-#define _XOPEN_SOURCE 600
-
 #include "config.h"
 #include "ntp.h"
 #include "ntp_types.h"



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/b1bb7919ed390fecec56c7fe152e5e555429829c...90b71eda980c646721c0b4145186bdbdfcd6e3c1

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/b1bb7919ed390fecec56c7fe152e5e555429829c...90b71eda980c646721c0b4145186bdbdfcd6e3c1
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20190922/fcb44b8e/attachment.htm>


More information about the vc mailing list