You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2013/07/15 14:41:48 UTC

svn commit: r1503204 - in /qpid/trunk/qpid/extras/dispatch: src/iterator.c src/parse.c tests/parse_test.c

Author: tross
Date: Mon Jul 15 12:41:48 2013
New Revision: 1503204

URL: http://svn.apache.org/r1503204
Log:
NO-JIRA - Fixed bug in parse-error handling.

Modified:
    qpid/trunk/qpid/extras/dispatch/src/iterator.c
    qpid/trunk/qpid/extras/dispatch/src/parse.c
    qpid/trunk/qpid/extras/dispatch/tests/parse_test.c

Modified: qpid/trunk/qpid/extras/dispatch/src/iterator.c
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/extras/dispatch/src/iterator.c?rev=1503204&r1=1503203&r2=1503204&view=diff
==============================================================================
--- qpid/trunk/qpid/extras/dispatch/src/iterator.c (original)
+++ qpid/trunk/qpid/extras/dispatch/src/iterator.c Mon Jul 15 12:41:48 2013
@@ -367,7 +367,7 @@ dx_field_iterator_t *dx_field_iterator_s
 void dx_field_iterator_advance(dx_field_iterator_t *iter, uint32_t length)
 {
     // TODO - Make this more efficient.
-    for (uint8_t idx = 0; idx < length; idx++)
+    for (uint8_t idx = 0; idx < length && !dx_field_iterator_end(iter); idx++)
         dx_field_iterator_octet(iter);
 }
 

Modified: qpid/trunk/qpid/extras/dispatch/src/parse.c
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/extras/dispatch/src/parse.c?rev=1503204&r1=1503203&r2=1503204&view=diff
==============================================================================
--- qpid/trunk/qpid/extras/dispatch/src/parse.c (original)
+++ qpid/trunk/qpid/extras/dispatch/src/parse.c Mon Jul 15 12:41:48 2013
@@ -94,6 +94,9 @@ static char *get_type_info(dx_field_iter
     if ((*tag == DX_AMQP_MAP8 || *tag == DX_AMQP_MAP32) && (*count & 1))
         return "Odd Number of Elements in a Map";
 
+    if (*clen > *length)
+        return "Insufficient Length to Determine Count";
+
     return 0;
 }
 

Modified: qpid/trunk/qpid/extras/dispatch/tests/parse_test.c
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/extras/dispatch/tests/parse_test.c?rev=1503204&r1=1503203&r2=1503204&view=diff
==============================================================================
--- qpid/trunk/qpid/extras/dispatch/tests/parse_test.c (original)
+++ qpid/trunk/qpid/extras/dispatch/tests/parse_test.c Mon Jul 15 12:41:48 2013
@@ -123,7 +123,7 @@ struct err_vector_t {
 {"\xb0\x00\x00",     3, "Insufficient Data to Determine Length"},        // 6
 {"\xb0\x00\x00\x00", 4, "Insufficient Data to Determine Length"},        // 7
 {"\xc0\x04",         2, "Insufficient Data to Determine Count"},         // 8
-{"\xd0\x00\x00\x00\x00\x00\x00\x00\x01",  9, "Insufficient Data to Determine Tag"},         // 9
+{"\xd0\x00\x00\x00\x00\x00\x00\x00\x01",  9, "Insufficient Length to Determine Count"}, // 9
 {0, 0, 0}
 };
 



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