Skip to content

Commit 0fc7e69

Browse files
hillbrookfengqikai1414
authored andcommitted
apollo-platform: fix rtps packet length overflow.
1 parent be9fdc2 commit 0fc7e69

File tree

3 files changed

+26
-14
lines changed

3 files changed

+26
-14
lines changed

ros/third_party/FastRTPS_1.4.0.patch

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
diff -Npur -x .git a/CMakeLists.txt b/CMakeLists.txt
2-
--- a/CMakeLists.txt 2017-09-14 15:59:29.813198704 +0800
3-
+++ b/CMakeLists.txt 2017-09-14 16:01:09.589195047 +0800
2+
--- a/CMakeLists.txt 2017-12-26 10:43:48.180704161 +0800
3+
+++ b/CMakeLists.txt 2017-12-26 10:47:06.596700607 +0800
44
@@ -175,9 +175,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PAT
55
# Default shared libraries
66
###############################################################################
@@ -13,8 +13,8 @@ diff -Npur -x .git a/CMakeLists.txt b/CMakeLists.txt
1313

1414
###############################################################################
1515
diff -Npur -x .git a/include/fastrtps/utils/IPFinder.h b/include/fastrtps/utils/IPFinder.h
16-
--- a/include/fastrtps/utils/IPFinder.h 2017-09-14 15:55:02.933208485 +0800
17-
+++ b/include/fastrtps/utils/IPFinder.h 2017-09-14 16:01:09.693195043 +0800
16+
--- a/include/fastrtps/utils/IPFinder.h 2017-12-26 10:43:48.296704159 +0800
17+
+++ b/include/fastrtps/utils/IPFinder.h 2017-12-26 10:47:06.720700605 +0800
1818
@@ -61,7 +61,7 @@ public:
1919
IPFinder();
2020
virtual ~IPFinder();
@@ -24,9 +24,21 @@ diff -Npur -x .git a/include/fastrtps/utils/IPFinder.h b/include/fastrtps/utils/
2424

2525
/**
2626
* Get the IP4Adresses in all interfaces.
27+
diff -Npur -x .git a/src/cpp/qos/ParameterList.cpp b/src/cpp/qos/ParameterList.cpp
28+
--- a/src/cpp/qos/ParameterList.cpp 2017-12-26 10:43:48.184704161 +0800
29+
+++ b/src/cpp/qos/ParameterList.cpp 2017-12-26 11:09:55.248676097 +0800
30+
@@ -369,7 +369,7 @@ int32_t ParameterList::readParameterList
31+
//cout << "Parameter length " << plength << endl;
32+
uint32_t vec_size = 0;
33+
valid&=CDRMessage::readUInt32(msg,&vec_size);
34+
- if(!valid || msg->pos+vec_size > msg->length){
35+
+ if(!valid || msg->pos > msg->length - vec_size){
36+
delete(p);
37+
return -1;
38+
}
2739
diff -Npur -x .git a/src/cpp/rtps/builtin/discovery/endpoint/EDPSimple.cpp b/src/cpp/rtps/builtin/discovery/endpoint/EDPSimple.cpp
28-
--- a/src/cpp/rtps/builtin/discovery/endpoint/EDPSimple.cpp 2017-09-14 15:59:29.821198703 +0800
29-
+++ b/src/cpp/rtps/builtin/discovery/endpoint/EDPSimple.cpp 2017-09-14 16:01:09.593195047 +0800
40+
--- a/src/cpp/rtps/builtin/discovery/endpoint/EDPSimple.cpp 2017-12-26 10:43:48.184704161 +0800
41+
+++ b/src/cpp/rtps/builtin/discovery/endpoint/EDPSimple.cpp 2017-12-26 10:47:06.600700607 +0800
3042
@@ -129,6 +129,9 @@ bool EDPSimple::createSEDPEndpoints()
3143
watt.times.nackResponseDelay.fraction = 0;
3244
watt.times.initialHeartbeatDelay.seconds = 0;
@@ -83,8 +95,8 @@ diff -Npur -x .git a/src/cpp/rtps/builtin/discovery/endpoint/EDPSimple.cpp b/src
8395
ratt.endpoint.reliabilityKind = RELIABLE;
8496
pdata->m_builtinReaders.push_back(ratt);
8597
diff -Npur -x .git a/src/cpp/transport/UDPv4Transport.cpp b/src/cpp/transport/UDPv4Transport.cpp
86-
--- a/src/cpp/transport/UDPv4Transport.cpp 2017-09-14 15:59:29.845198702 +0800
87-
+++ b/src/cpp/transport/UDPv4Transport.cpp 2017-09-14 16:01:09.593195047 +0800
98+
--- a/src/cpp/transport/UDPv4Transport.cpp 2017-12-26 10:43:48.184704161 +0800
99+
+++ b/src/cpp/transport/UDPv4Transport.cpp 2017-12-26 10:47:06.600700607 +0800
88100
@@ -31,7 +31,7 @@ static const uint32_t maximumUDPSocketSi
89101
static const uint32_t maximumMessageSize = 65500;
90102
static const uint8_t defaultTTL = 1;
@@ -111,8 +123,8 @@ diff -Npur -x .git a/src/cpp/transport/UDPv4Transport.cpp b/src/cpp/transport/UD
111123
}
112124

113125
diff -Npur -x .git a/thirdparty/fastcdr/CMakeLists.txt b/thirdparty/fastcdr/CMakeLists.txt
114-
--- a/thirdparty/fastcdr/CMakeLists.txt 2017-09-14 16:00:20.797196835 +0800
115-
+++ b/thirdparty/fastcdr/CMakeLists.txt 2017-09-14 16:01:09.629195045 +0800
126+
--- a/thirdparty/fastcdr/CMakeLists.txt 2017-12-26 10:43:48.228704160 +0800
127+
+++ b/thirdparty/fastcdr/CMakeLists.txt 2017-12-26 10:47:06.640700607 +0800
116128
@@ -106,9 +106,7 @@ endif()
117129
# Default shared libraries
118130
###############################################################################
@@ -125,8 +137,8 @@ diff -Npur -x .git a/thirdparty/fastcdr/CMakeLists.txt b/thirdparty/fastcdr/CMak
125137

126138
###############################################################################
127139
diff -Npur -x .git a/thirdparty/fastcdr/include/fastcdr/Cdr.h b/thirdparty/fastcdr/include/fastcdr/Cdr.h
128-
--- a/thirdparty/fastcdr/include/fastcdr/Cdr.h 2017-09-14 16:00:20.821196834 +0800
129-
+++ b/thirdparty/fastcdr/include/fastcdr/Cdr.h 2017-09-14 16:01:09.629195045 +0800
140+
--- a/thirdparty/fastcdr/include/fastcdr/Cdr.h 2017-12-26 10:43:48.228704160 +0800
141+
+++ b/thirdparty/fastcdr/include/fastcdr/Cdr.h 2017-12-26 10:47:06.644700607 +0800
130142
@@ -726,6 +726,7 @@ namespace eprosima
131143
* @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
132144
*/
@@ -162,8 +174,8 @@ diff -Npur -x .git a/thirdparty/fastcdr/include/fastcdr/Cdr.h b/thirdparty/fastc
162174
#if HAVE_CXX0X
163175
/*!
164176
diff -Npur -x .git a/thirdparty/fastcdr/src/cpp/Cdr.cpp b/thirdparty/fastcdr/src/cpp/Cdr.cpp
165-
--- a/thirdparty/fastcdr/src/cpp/Cdr.cpp 2017-09-14 16:00:20.821196834 +0800
166-
+++ b/thirdparty/fastcdr/src/cpp/Cdr.cpp 2017-09-14 16:01:09.629195045 +0800
177+
--- a/thirdparty/fastcdr/src/cpp/Cdr.cpp 2017-12-26 10:43:48.228704160 +0800
178+
+++ b/thirdparty/fastcdr/src/cpp/Cdr.cpp 2017-12-26 10:47:06.640700607 +0800
167179
@@ -570,6 +570,38 @@ Cdr& Cdr::serialize(const char *string_t
168180
return *this;
169181
}
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)