Catches the case where the depth is not terminated with a
semicolon (eg: "depth:17 classtype:trojan-activity") which
is usually a sign the rule has a missing semi-colon.
Goto the failure label instead of returning which will allow the open
directory to get cleaned up.
Fixes:
*** CID 1394675: Resource leaks (RESOURCE_LEAK)
/src/log-pcap.c: 615 in PcapLogInitRingBuffer()
609 * failure as the file might just not be a pcap log file. */
610 continue;
611 }
612
613 PcapFileName *pf = SCCalloc(sizeof(*pf), 1);
614 if (unlikely(pf == NULL)) {
>>> CID 1394675: Resource leaks (RESOURCE_LEAK)
>>> Variable "dir" going out of scope leaks the storage it points to.
615 return TM_ECODE_FAILED;
616 }
617 char path[PATH_MAX];
618 snprintf(path, PATH_MAX - 1, "%s/%s", pattern, entry->d_name);
619 if ((pf->filename = SCStrdup(path)) == NULL) {
620 goto fail;
This also means that pf can be NULL which should clear up CID
1394676 (REVERSE_INULL).
On start, look for existing pcap log files and add them to
the ring buffer. This makes pcap-log self maintaining over
restarts removing the need for external tools to clear
orphaned files.
Luajit has a strange memory requirement, it's 'states' need to be in the
first 2G of the process' memory.
This patch improves the pool approach by moving it to the front of the
start up.
A new config option 'luajit.states' is added to control how many states
are preallocated. It defaults to 128.
Add a warning when more states are used then preallocated. This may fail
if flow/stream/detect engines use a lot of memory. Add hint at exit that
gives the max states in use if it's higher than the default.
The Makefile generated by sphinx-build is GNU Make specific
causing the PDF phase to fail. Instead call pdflatex directly
based on how the generated Makefile was doing it.