adriancole commented on a change in pull request #2588: Consolidates buffers 
and generally improves string decoding
URL: https://github.com/apache/incubator-zipkin/pull/2588#discussion_r283119034
 
 

 ##########
 File path: zipkin/src/main/java/zipkin2/internal/Proto3Fields.java
 ##########
 @@ -124,13 +124,18 @@ final void write(UnsafeBuffer b, T value) {
      * is returned when the length prefix is zero.
      */
     final T readLengthPrefixAndValue(UnsafeBuffer b) {
-      int length = readLengthPrefix(b);
+      int length = guardLength(b);
       if (length == 0) return null;
       return readValue(b, length);
     }
 
-    final int readLengthPrefix(UnsafeBuffer b) {
-      return b.readVarint32();
+    final int guardLength(UnsafeBuffer buffer) {
 
 Review comment:
   unrelated.. I noticed that we weren't checking bounds in proto eventhough we 
were in thrift

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to