qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r1655518 - /qpid/dispatch/trunk/src/parse.c
Date Thu, 29 Jan 2015 03:12:20 GMT
Author: aconway
Date: Thu Jan 29 03:12:20 2015
New Revision: 1655518

URL: http://svn.apache.org/r1655518
Log:
NO-JIRA: Dispatch incorrectly decodes negative small long values.

Modified:
    qpid/dispatch/trunk/src/parse.c

Modified: qpid/dispatch/trunk/src/parse.c
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/src/parse.c?rev=1655518&r1=1655517&r2=1655518&view=diff
==============================================================================
--- qpid/dispatch/trunk/src/parse.c (original)
+++ qpid/dispatch/trunk/src/parse.c Thu Jan 29 03:12:20 2015
@@ -257,17 +257,21 @@ int32_t qd_parse_as_int(qd_parsed_field_
     case QD_AMQP_INT:
         result |= ((int32_t) qd_field_iterator_octet(field->raw_iter)) << 24;
         result |= ((int32_t) qd_field_iterator_octet(field->raw_iter)) << 16;
+        // Fall Through...
 
     case QD_AMQP_SHORT:
         result |= ((int32_t) qd_field_iterator_octet(field->raw_iter)) << 8;
         // Fall Through...
 
     case QD_AMQP_BYTE:
-    case QD_AMQP_SMALLINT:
     case QD_AMQP_BOOLEAN:
         result |= (int32_t) qd_field_iterator_octet(field->raw_iter);
         break;
 
+    case QD_AMQP_SMALLINT:
+        result = (int8_t) qd_field_iterator_octet(field->raw_iter);
+        break;
+
     case QD_AMQP_TRUE:
         result = 1;
         break;
@@ -292,10 +296,11 @@ int64_t qd_parse_as_long(qd_parsed_field
         result |= ((int64_t) qd_field_iterator_octet(field->raw_iter)) << 24;
         result |= ((int64_t) qd_field_iterator_octet(field->raw_iter)) << 16;
         result |= ((int64_t) qd_field_iterator_octet(field->raw_iter)) << 8;
-        // Fall Through...
+        result |= (uint64_t) qd_field_iterator_octet(field->raw_iter);
+        break;
 
     case QD_AMQP_SMALLLONG:
-        result |= (uint64_t) qd_field_iterator_octet(field->raw_iter);
+        result = (int8_t) qd_field_iterator_octet(field->raw_iter);
         break;
     }
 



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


Mime
View raw message