summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2015-01-13 10:25:15 +0000
committerGordon Sim <gsim@apache.org>2015-01-13 10:25:15 +0000
commitf457cc314c6bc692731a87e8fed86d049e7c66c6 (patch)
tree929047edb652349f2f48fb1ba721a1b72547bc4c /qpid/cpp/src
parent5a984f552b92187ef0a09d035db9a51009279a7a (diff)
downloadqpid-python-f457cc314c6bc692731a87e8fed86d049e7c66c6.tar.gz
QPID-6310: check validity of ranges when decoding sequence set
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1651321 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/qpid/framing/SequenceSet.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/qpid/cpp/src/qpid/framing/SequenceSet.cpp b/qpid/cpp/src/qpid/framing/SequenceSet.cpp
index 72fcd8a9e2..845bf8bfae 100644
--- a/qpid/cpp/src/qpid/framing/SequenceSet.cpp
+++ b/qpid/cpp/src/qpid/framing/SequenceSet.cpp
@@ -54,7 +54,11 @@ void SequenceSet::decode(Buffer& buffer)
throw IllegalArgumentException(QPID_MSG("Invalid size for sequence set: " << size));
for (uint16_t i = 0; i < count; i++) {
- add(SequenceNumber(buffer.getLong()), SequenceNumber(buffer.getLong()));
+ SequenceNumber a(buffer.getLong());
+ SequenceNumber b(buffer.getLong());
+ if (b < a)
+ throw IllegalArgumentException(QPID_MSG("Invalid range in sequence set: " << a << " -> " << b));
+ add(a, b);
}
}