mhlakhani commented on code in PR #3139:
URL: https://github.com/apache/thrift/pull/3139#discussion_r2096970793


##########
lib/cpp/src/thrift/protocol/TJSONProtocol.cpp:
##########
@@ -1087,7 +1087,10 @@ uint32_t TJSONProtocol::readBool(bool& value) {
 uint32_t TJSONProtocol::readByte(int8_t& byte) {
   auto tmp = (int16_t)byte;
   uint32_t result = readJSONInteger(tmp);
-  assert(tmp < 256);
+  if (tmp > 255 || tmp < -128) {

Review Comment:
   thanks for the info, @Jens-G!
   
   What do you suggest? I see two options:
   
   1. make this check be as per the suggestion below. This may break existing 
code potentially, though I'd argue it may be buggy.
   2. Just remove the assert.
   
   Happy to do whatever you prefer.
   
   ```suggestion
     if (tmp > 127 || tmp < -128) {
   ```



-- 
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: notifications-unsubscr...@thrift.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to