diff --git a/src/portmap-analyzer.pac b/src/portmap-analyzer.pac index 546be2e9cc..1e7921a9ff 100644 --- a/src/portmap-analyzer.pac +++ b/src/portmap-analyzer.pac @@ -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); diff --git a/src/portmap-protocol.pac b/src/portmap-protocol.pac index d9f3e5be97..65a478fb2d 100644 --- a/src/portmap-protocol.pac +++ b/src/portmap-protocol.pac @@ -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 {