You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zipkin.apache.org by GitBox <gi...@apache.org> on 2019/05/11 07:04:10 UTC

[GitHub] [incubator-zipkin] anuraaga commented on a change in pull request #2582: Reuse char[] buffer when decoding hex fields.

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:
users@infra.apache.org


With regards,
Apache Git Services