Commit 5459350f authored by Peter V. Saveliev's avatar Peter V. Saveliev
Browse files

nlmsg: bypass length setting if the header is missing

parent 49fa3d41
......@@ -959,7 +959,8 @@ class nlmsg_base(dict):
offset += struct.calcsize(fmt)
# update length from header
# it can not be less than 4
self.length = max(self['header']['length'], 4)
if 'header' in self:
self.length = max(self['header']['length'], 4)
# handle the array case
if self._nla_array:
self.setvalue([])
......
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