anuraaga commented on a change in pull request #2582: Reuse char[] buffer when 
decoding hex fields.
URL: https://github.com/apache/incubator-zipkin/pull/2582#discussion_r283085319
 
 

 ##########
 File path: zipkin/src/main/java/zipkin2/internal/Proto3Fields.java
 ##########
 @@ -190,15 +197,21 @@ static int decodeLowerHex(char c) {
 
     @Override String readValue(Buffer buffer, int length) {
       length *= 2;
-      char[] result = new char[length];
+
+      // All our hex fields are at most 32 characters.
+      if (length > 32) {
 
 Review comment:
   Since the data comes over the wire, it's possible a bad client or something 
would send bad data. I think we would generally want a runtime check for 
incoming data which wouldn't be a local programming bug. What do you think?

----------------------------------------------------------------
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