Skip to content

Commit

Permalink
os/kstore: fix u64 decode checks
Browse files Browse the repository at this point in the history
Signed-off-by: Sage Weil <[email protected]>
  • Loading branch information
liewegas committed Jan 18, 2016
1 parent f8ea3eb commit 3286106
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/os/kstore/KStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -302,19 +302,13 @@ static int get_key_object(const string& key, ghobject_t *oid)
const char *p = key.c_str();

p = _key_decode_shard(p, &oid->shard_id);
if (!*p)
return -2;

uint64_t pool;
p = _key_decode_u64(p, &pool);
if (!*p)
return -3;
oid->hobj.pool = pool - 0x8000000000000000ull;

unsigned hash;
p = _key_decode_u32(p, &hash);
if (!*p)
return -4;
oid->hobj.set_bitwise_key_u32(hash);
if (*p != '.')
return -5;
Expand Down Expand Up @@ -351,8 +345,6 @@ static int get_key_object(const string& key, ghobject_t *oid)
}

p = _key_decode_u64(p, &oid->hobj.snap.val);
if (!*p)
return -11;
p = _key_decode_u64(p, &oid->generation);
if (*p) {
// if we get something other than a null terminator here,
Expand Down

0 comments on commit 3286106

Please sign in to comment.