This is an automated email from the ASF dual-hosted git repository.

PragmaTwice pushed a commit to branch twice/hash-mode-restrict
in repository https://gitbox.apache.org/repos/asf/kvrocks.git

commit f8274b8ad9e212490f06cf661d8a66694e0f42b1
Author: Twice <[email protected]>
AuthorDate: Fri May 15 23:00:38 2026 +0800

    feat(hash): restrict condition for hash encoding mode
---
 src/storage/redis_metadata.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/storage/redis_metadata.cc b/src/storage/redis_metadata.cc
index 6945a0a6d..f64af56c7 100644
--- a/src/storage/redis_metadata.cc
+++ b/src/storage/redis_metadata.cc
@@ -371,7 +371,7 @@ rocksdb::Status HashMetadata::Decode(Slice *input) {
 
   uint8_t encoded_mode = 0;
   GetFixed8(input, &encoded_mode);
-  if (encoded_mode > 
static_cast<uint8_t>(HashSubkeyEncodingMode::kFieldExpiration)) {
+  if (encoded_mode != 
static_cast<uint8_t>(HashSubkeyEncodingMode::kFieldExpiration)) {
     return rocksdb::Status::InvalidArgument("invalid hash subkey encoding 
mode");
   }
 

Reply via email to