Browse files

Fix buffer underflow when retrieving boolean from binary annotation

  • Loading branch information...
1 parent c6cd63f commit ebbe5f5b4cb0b84651d946a4b052629a9a572231 Franklin Hu committed Sep 5, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 zipkin-finatra/src/main/scala/com/twitter/zipkin/adapter/JsonAdapter.scala
View
2 zipkin-finatra/src/main/scala/com/twitter/zipkin/adapter/JsonAdapter.scala
@@ -24,7 +24,7 @@ object JsonAdapter extends Adapter {
def apply(b: BinaryAnnotation): binaryAnnotationType = {
val value = b.annotationType match {
- case AnnotationType(0, _) => b.value.getInt // bool
+ case AnnotationType(0, _) => if (b.value.get() == 0) false else true // bool
case AnnotationType(1, _) => new String(b.value.array(), b.value.position(), b.value.remaining()) // bytes
case AnnotationType(2, _) => b.value.getShort // i16
case AnnotationType(3, _) => b.value.getInt // i32

0 comments on commit ebbe5f5

Please sign in to comment.