Fix an issue we hit 1 in 1000 times.

Turns out, that because the name consumption is fairly lax (often lots
of excess space after the name, etc) we were reading 2 too many bytes
(because we weren't taken the length of the leaf off the available
length).  This would error when it so happened that a structure was at
the end of the type list and we'd read past the end of the tpi stream.
This commit is contained in:
Mike Auty
2019-07-30 22:14:19 +01:00
committed by ikelos
parent e729877d38
commit 7a0b71f7ae
@@ -722,6 +722,7 @@ class PdbReader:
module.get_enumeration("LEAF_TYPE"), layer_name = module._layer_name, offset = offset)
consumed = leaf_type.vol.base_type.size
offset += consumed
length -= consumed
if leaf_type in [
leaf_type.LF_CLASS, leaf_type.LF_CLASS_ST, leaf_type.LF_STRUCTURE, leaf_type.LF_STRUCTURE_ST,