Author: gsim
Date: Tue Jan 13 10:25:15 2015
New Revision: 1651321

URL: http://svn.apache.org/r1651321
Log:
QPID-6310: check validity of ranges when decoding sequence set

Modified:
    qpid/trunk/qpid/cpp/src/qpid/framing/SequenceSet.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/framing/SequenceSet.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/framing/SequenceSet.cpp?rev=1651321&r1=1651320&r2=1651321&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/framing/SequenceSet.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/framing/SequenceSet.cpp Tue Jan 13 10:25:15 
2015
@@ -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);
     }
 }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org

Reply via email to