aboutsummaryrefslogtreecommitdiff
path: root/astro/gpstk
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
parentca9d7c2375398bfcd324246b164212977e7f994d (diff)
downloadports-3325430aeea8ea84a271dc2dfd5a6eda261064f7.tar.gz
ports-3325430aeea8ea84a271dc2dfd5a6eda261064f7.zip
- Fix insufficient buffer size for reading dual frequency NovaTel OEM4 range data
PR: 140855 Submitted by: IPS FreeBSD <freebsd@ips.gov.au>
Notes
Notes: svn path=/head/; revision=244920
Diffstat (limited to 'astro/gpstk')
-rw-r--r--astro/gpstk/Makefile1
-rw-r--r--astro/gpstk/files/patch-lib-rxio-NovatelData.cpp23
-rw-r--r--astro/gpstk/files/patch-lib-rxio-NovatelData.hpp11
3 files changed, 35 insertions, 0 deletions
diff --git a/astro/gpstk/Makefile b/astro/gpstk/Makefile
index 2562d27f567a..bf4c859343a7 100644
--- a/astro/gpstk/Makefile
+++ b/astro/gpstk/Makefile
@@ -7,6 +7,7 @@
PORTNAME= gpstk
PORTVERSION= 1.5
+PORTREVISION= 1
CATEGORIES= astro devel
MASTER_SITES= SF
DISTNAME= ${PORTNAME}${PORTVERSION}.src
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;
diff --git a/astro/gpstk/files/patch-lib-rxio-NovatelData.hpp b/astro/gpstk/files/patch-lib-rxio-NovatelData.hpp
new file mode 100644
index 000000000000..8c26ee2117cd
--- /dev/null
+++ b/astro/gpstk/files/patch-lib-rxio-NovatelData.hpp
@@ -0,0 +1,11 @@
+--- lib/rxio/NovatelData.hpp.FCS 2009-11-24 09:08:58.000000000 +1100
++++ lib/rxio/NovatelData.hpp 2009-11-24 09:09:34.000000000 +1100
+@@ -165,7 +165,7 @@
+
+ private:
+ /// private data members
+- unsigned char buffer[1024]; ///< buffer for raw data
++ unsigned char buffer[2048]; ///< buffer for raw data
+
+ /// Reference GPS week, for OEM2, where the nav records require a GPS week,
+ /// but only the obs records have one, and then it is 10-bit.