You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "jackyyyyyssss (via GitHub)" <gi...@apache.org> on 2024/05/31 07:52:11 UTC

Re: [PR] fix(json): int64 overflow in JSON numop [kvrocks]

jackyyyyyssss commented on code in PR #2340:
URL: https://github.com/apache/kvrocks/pull/2340#discussion_r1621908352


##########
src/types/redis_json.cc:
##########
@@ -452,6 +452,11 @@ rocksdb::Status Json::numop(JsonValue::NumOpEnum op, const std::string &user_key
   if (!number_res || !number_res.GetValue().value.is_number()) {
     return rocksdb::Status::InvalidArgument("should be a number");
   }
+
+  if (!number_res.GetValue().value.is_int64() && !number_res.GetValue().value.is_double()) {
+    return rocksdb::Status::InvalidArgument("number out of range");
+  }

Review Comment:
   Thank you. Summarized all the situations to see if there were any omissions



-- 
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: issues-unsubscribe@kvrocks.apache.org

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