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

git-hulk pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/kvrocks.git


The following commit(s) were added to refs/heads/unstable by this push:
     new 88009fad3 feat(hash): restrict condition for hash encoding mode (#3488)
88009fad3 is described below

commit 88009fad36b3a4e1d71fb58db588ebce071761be
Author: Twice <[email protected]>
AuthorDate: Sun May 17 12:49:24 2026 +0800

    feat(hash): restrict condition for hash encoding mode (#3488)
    
    `encoded_mode == 0` should not be valid here since when encoding mode is
    legacy this field should be missing.
---
 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 71a279149..d62e566ff 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