Commit b54c893a by Craig Heffner

Added stricter validation of signature data types

parent 4ebb987c
......@@ -211,9 +211,11 @@ class SignatureLine(object):
self.fmt = 'q'
self.size = 8
# Assume 4 byte length for all other data types
else:
elif self.type in ['long', 'date']:
self.fmt = 'i'
self.size = 4
else:
raise ParserException("Unknown data type '%s' in line '%s'" % (self.type, line))
# The struct module uses the same characters for specifying signed and unsigned data types,
# except that signed data types are upper case. The above if-else code sets self.fmt to the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment