Skip to content

Commit

Permalink
Use correct type size in unpack_type. Closes #30
Browse files Browse the repository at this point in the history
  • Loading branch information
oschwald committed Nov 2, 2017
1 parent 0b651e2 commit 8b64020
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
History
-------

* Fix issue where incorrect size was used when unpacking some types with the
pure Python reader. Reported by Lee Symes. GitHub #30.


1.3.0 (2017-03-13)
++++++++++++++++++

Expand Down
2 changes: 1 addition & 1 deletion maxminddb/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def _decode_packed_type(type_code, type_size, pad=False):
def unpack_type(self, size, offset):
if not pad:
self._verify_size(size, type_size)
new_offset = offset + type_size
new_offset = offset + size
packed_bytes = self._buffer[offset:new_offset]
if pad:
packed_bytes = packed_bytes.rjust(type_size, b'\x00')
Expand Down

0 comments on commit 8b64020

Please sign in to comment.