[Git][NTPsec/ntpsec][master] refclock_gpsd: Partially mitigate overrun of "buffer".

Gary E. Miller gitlab at mg.gitlab.com
Sat Mar 2 21:21:32 UTC 2019


Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
8a4b4a66 by Gary E. Miller at 2019-03-02T21:20:42Z
refclock_gpsd: Partially mitigate overrun of "buffer".

Not a fix.  Just a longer buffer.  Needs to be fixed.

- - - - -


1 changed file:

- ntpd/refclock_gpsd.c


Changes:

=====================================
ntpd/refclock_gpsd.c
=====================================
@@ -166,7 +166,10 @@ typedef unsigned long int json_uint;
 #define	NAME		"GPSD"	/* shortname */
 #define	DESCRIPTION	"GPSD JSON client clock" /* who we are */
 
-#define MAX_PDU_LEN	1600
+/* MAX_PDU_LEN needs to be bigger than GPS_JSON_RESPONSE_MAX from gpsd.
+ * As of March 2019 that is 4096 */
+#define MAX_PDU_LEN	8192
+
 #define TICKOVER_LOW	10
 #define TICKOVER_HIGH	120
 #define LOGTHROTTLE	SECSPERHR
@@ -658,6 +661,7 @@ gpsd_receive(
 	pdst = up->buffer + up->buflen;
 	edst = pdst + sizeof(up->buffer) - 1; /* for trailing NUL */
 
+        /* FIXME!! Check for overrun of "buffer" */
 	while (psrc != esrc) {
 		ch = *psrc++;
 		if (ch == '\n') {



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/8a4b4a66f282b797f11a3f7626d246ce016907cd

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/8a4b4a66f282b797f11a3f7626d246ce016907cd
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/20190302/06d79fec/attachment.html>


More information about the vc mailing list