Skip to content

Commit

Permalink
fix zero length strings in key part 2 of UuidStringKeysMixin (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
oberstet authored Mar 14, 2022
1 parent 5a00ad7 commit baad743
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions zlmdb/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,9 +761,12 @@ def _serialize_key(self, key1_key2):

def _deserialize_key(self, data):
assert type(data) == bytes
assert len(data) > 16
data1, data2 = data[:16], data[16:]

assert len(data) >= 16
data1 = data[:16]
if len(data) > 16:
data2 = data[16:]
else:
data2 = b''
return uuid.UUID(bytes=data1), data2.decode('utf8')


Expand Down
2 changes: 1 addition & 1 deletion zlmdb/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
#
###############################################################################

__version__ = '22.3.1.dev1'
__version__ = '22.3.1.dev2'

0 comments on commit baad743

Please sign in to comment.