chaokunyang commented on PR #1565:
URL: https://github.com/apache/incubator-fury/pull/1565#issuecomment-2080343071

   > There is another question. If input string is empty, encoded bytes is also 
empty:
   > 
   > ```java
   > public MetaString encode(String input, Encoding encoding) {
   >   Preconditions.checkArgument(
   >       input.length() < Short.MAX_VALUE, "Long meta string than 32767 is 
not allowed");
   >   if (input.isEmpty()) {
   >     return new MetaString(input, Encoding.UTF_8, specialChar1, 
specialChar2, new byte[0]);
   >   }
   > }
   > ```
   > 
   > However, decode procedure doesn't check empty. It will access `bytes[0]` 
directly:
   > 
   > ```java
   > private String decodeLowerSpecial(byte[] data) {
   >   StringBuilder decoded = new StringBuilder();
   >   int totalBits = data.length * 8; // Total number of bits in the data
   >   boolean stripLastChar = (data[0] & 0x80) != 0; // Check the first bit of 
the first byte
   > }
   > ```
   > 
   > So decode procedure should check empty.
   
   Hi @qingoba , do you have time to fix this today? We plan to start release 
fury [v0.5.0](#1389) today and include this fix. If you don't have time, I can 
take over it and submit a fix later


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to