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

 ##########
 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:
   if that's possible, I'd throw an IllegalArgumentException as that's what we 
use for other malformed data at the moment.

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