Fix for portmapper analyzer segfaulting when parsing portmap dump

replies. (Gregor Maier)

Closes #332.
This commit is contained in:
Robin Sommer 2011-01-10 12:19:13 -08:00
parent f228e32679
commit 06bd8baef6
2 changed files with 5 additions and 0 deletions

View file

@ -79,6 +79,10 @@ function PortmapBuildDumpVal(params: PortmapDumpResults): BroVal
for ( int i = 0; i < params->size(); ++i )
{
// The last element has cont()!=1 and this element doesn't contain a
// mapping.
if ((*params)[i]->cont() != 1)
continue;
Val* m = PortmapBuildMappingVal((*params)[i]->mapping());
Val* index = new Val(i + 1, TYPE_COUNT);
mappings->Assign(index, m);

View file

@ -68,6 +68,7 @@ type PortmapDumpEntry = record {
};
};
# The final element that has cont!=1 will be included in the array.
type PortmapDumpResults = PortmapDumpEntry[] &until($element.cont != 1);
type PortmapCallItResults = record {