summaryrefslogtreecommitdiff
path: root/astro/gpstk/files/patch-lib-rxio-NovatelData.cpp
diff options
context:
space:
mode:
authorDmitry Marakasov <amdmi3@FreeBSD.org>2009-11-28 15:14:47 +0000
committerDmitry Marakasov <amdmi3@FreeBSD.org>2009-11-28 15:14:47 +0000
commit3325430aeea8ea84a271dc2dfd5a6eda261064f7 (patch)
treea023d3e0c03ee4c4d5e533bd3b02546afafbd8be /astro/gpstk/files/patch-lib-rxio-NovatelData.cpp
parent- set LATEST_LINK to not overlap with sysutils/filelight (diff)
- Fix insufficient buffer size for reading dual frequency NovaTel OEM4 range data
PR: 140855 Submitted by: IPS FreeBSD <freebsd@ips.gov.au>
Diffstat (limited to 'astro/gpstk/files/patch-lib-rxio-NovatelData.cpp')
-rw-r--r--astro/gpstk/files/patch-lib-rxio-NovatelData.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/astro/gpstk/files/patch-lib-rxio-NovatelData.cpp b/astro/gpstk/files/patch-lib-rxio-NovatelData.cpp
new file mode 100644
index 000000000000..8dc0df69f062
--- /dev/null
+++ b/astro/gpstk/files/patch-lib-rxio-NovatelData.cpp
@@ -0,0 +1,23 @@
+--- lib/rxio/NovatelData.cpp.FCS 2009-11-24 09:08:46.000000000 +1100
++++ lib/rxio/NovatelData.cpp 2009-11-24 09:40:31.000000000 +1100
+@@ -304,7 +304,9 @@
+ cout << "datasize:" << datasize << endl;
+
+ // read the rest of the record
+- if(datasize-12 >= 1024) {
++ // Note: OEM2 The Message byte count equals the total
++ // length of the data block including the header.
++ if(datasize >= sizeof(buffer)) {
+ //FFStreamError fe("Read error - buffer overflow");
+ //GPSTK_THROW(fe);
+ failure = 1;
+@@ -440,7 +442,8 @@
+ // ---------------------------------------
+ // read the data message, but don't overwrite the header
+ // first check against buffer overflow
+- if(datasize-28 >= 1024 || datasize-28 < 0) {
++ // OEM4 total buffer usage = header+data
++ if(datasize+28 >= sizeof(buffer)) {
+ //FFStreamError fe("Read error - buffer overflow");
+ //GPSTK_THROW(fe);
+ failure = 1;