From dfebe3fac76ebb27c39d6cb0a623b3b24ed95572 Mon Sep 17 00:00:00 2001 From: "Gary E. Miller" Date: Wed, 6 Apr 2016 13:59:17 -0700 Subject: RTCM3 packets can be bigger than RTCM2 ones. I have seen up to about 490 in RTCM3. --- gpsd.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gpsd.c') diff --git a/gpsd.c b/gpsd.c index 2381e17c..6f575cd5 100644 --- a/gpsd.c +++ b/gpsd.c @@ -1474,10 +1474,16 @@ static void all_reports(struct gps_device_t *device, gps_mask_t changed) * If the device provided an RTCM packet, repeat it to all devices. */ if ((changed & RTCM2_SET) != 0 || (changed & RTCM3_SET) != 0) { - if (device->lexer.outbuflen > RTCM_MAX) { + if ((changed & RTCM2_SET) != 0 + && device->lexer.outbuflen > RTCM_MAX) { gpsd_log(&context.errout, LOG_ERROR, "overlong RTCM packet (%zd bytes)\n", device->lexer.outbuflen); + } else if ((changed & RTCM3_SET) != 0 + && device->lexer.outbuflen > RTCM3_MAX) { + gpsd_log(&context.errout, LOG_ERROR, + "overlong RTCM3 packet (%zd bytes)\n", + device->lexer.outbuflen); } else { struct gps_device_t *dp; for (dp = devices; dp < devices+MAX_DEVICES; dp++) { -- cgit v1.2.1