diff options
author | Gary E. Miller <gem@rellim.com> | 2016-09-01 12:36:04 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2016-09-01 12:36:04 -0700 |
commit | 8f74020d331f0aa1fd165f2d9490fc66022745c2 (patch) | |
tree | 54602a867b2d0161ddcffb070fdb0f49f38e9a7d /gpsd.h-tail | |
parent | ee329c32da0ab85e1a3334ce5377f0b57cf954ce (diff) | |
download | gpsd-8f74020d331f0aa1fd165f2d9490fc66022745c2.tar.gz |
Fix too small buffers. Hex is 2x + 1 the size of binary.
Diffstat (limited to 'gpsd.h-tail')
-rw-r--r-- | gpsd.h-tail | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gpsd.h-tail b/gpsd.h-tail index 97345d1a..d1fb5ead 100644 --- a/gpsd.h-tail +++ b/gpsd.h-tail @@ -492,7 +492,11 @@ struct gps_device_t { #endif /* PPS_ENABLE */ double mag_var; /* magnetic variation in degrees */ bool back_to_nmea; /* back to NMEA on revert? */ - char msgbuf[MAX_PACKET_LENGTH*2+1]; /* command message buffer for sends */ + /* + * msgbuf needs to hold the hex decode of inbuffer + * so msgbuf must be 2x the size of inbuffer + */ + char msgbuf[MAX_PACKET_LENGTH*4+1]; /* command message buffer for sends */ size_t msgbuflen; int observed; /* which packet type`s have we seen? */ bool cycle_end_reliable; /* does driver signal REPORT_MASK */ |