Commit Graph

4473 Commits (a7a77e32cac298a64c6c2ea5d30d4dc37ef3f5bc)
 

Author SHA1 Message Date
Kirby Kuehl 08915649f3 fix double free 15 years ago
Victor Julien f4a23f2325 Fixup noisy debug statement. 15 years ago
Victor Julien 0d34990d7f Add OpenBSD's strlcpy and strlcat and replace all strcat/strcpy/strncat/strncpy by those calls. 15 years ago
Jason Ish 7d920a1254 Fix issue 65.
- Update unit test to trigger the failure found in the issue 65 pcap.
- Increase pkt buffer to account for the IPv6 header, as a maximum
  size IPv6 datagram is 40 + 0xffff.
- Account for IPv4 header when checking where end of fragment lies.
- Second sanity check during re-assembly to check for writing past
  the end of the pkt buffer.
15 years ago
Victor Julien 1b8f391607 Fixup flowbits signature keyword parsing memory handling. 15 years ago
Steve Grubb c95cd2e80a memory leak cleanups in misc places
Hello,

This is all the rest of the memory leaks I found.

*In src/source-pcap-file.c at line 152, ptv is not being freed.
*In src/util-unittest-helper.c at line 152, p was not being freed.
*In src/log-httplog.c at line 195, aft was not being freed
*In src/counters.c at line 51, log_filename was not being freed. At line 1188
pctx is being tested to see if its NULL. However, at 1173 it exits the
function if it were NULL. This test is not needed and should be deleted.
*In src/defrag.c at line 351, tracker was not being freed. At line 390, dc is
being checked for NULL but this was already done at line 384. Probably what
was meant was checking the value of dc->frag_table which was just assigned.

The patch below makes the above described changes.

-Steve
15 years ago
Steve Grubb 60ad9d29c5 Memory leak cleanup in detectors
Hello,

I ran the code through an analysis program and found several leaks that
should be cleaned up.

*In src/detect-engine-address-ipv4.c at line 472, the test for ag == NULL
will never be true since that is the loop entry test.
*In src/detect-engine-port.c at line 1133, the test for p == NULL will
never be true since that is the loop entry test.
*In src/detect-engine-mpm.c at line 263 is a return without freeing
fast_pattern
*In src/detect-ack.c at line 80 and 85, data catches the return from malloc.
One of them should be deleted.
*In src/detect-seq.c at line 81 and 86, data catches the return from malloc.
One of them should be deleted.
*In src/detect-content.c at line 749, many of the paths that lead to the error
exit still has temp pointing to allocated memory. To clean this up, temp
should be set to NULL if not immediately assigning and new value.
*In src/detect-uricontent.c at line 319, both cd and str needto be freed. At
lines 344, str needs to be freed. And at line 347 str and temp need to be
freed.
*In src/detect-flowbits.c at line 231 and 235, str was not being freed. cd was
not being freed at line 235.
*In src/detect-flowvar.c at line 127, str was not being freed. At line 194, cd
and str were not being freed.
*In src/detect-flowint.c at line 277, sfd was not being freed. At line 315, str
was not being freed.
*In src/detect-pktvar.c at line 121, str was not being freed. At line 188, str
and cd was not being freed.
*In src/detect-pcre.c at line 389, there is an extra free of "re" that should
be deleted.
*In src/detect-depth.c at line 42 & 48, str has not been freed.
*In src/detect-distance.c at line 49 and 55, str has not been freed
*In src/detect-offset.c at line 45, str has not been freed.

The patch below fixes these issues.

-Steve
15 years ago
Steve Grubb f6653752c5 memory leak cleanup in alerts
Hello,

I ran the code through an analysis program and found several memory leaks
in the alert code.

*In src/alert-fastlog.c at line 178, aft was not being freed
*In src/alert-debuglog.c at line 205, aftwas not being freed
*In src/alert-unified-log.c at lines 234 and 243, aun was not being freed
*In src/alert-unified-alert.c at lines 219 and 230, aun was not being freed
*In src/alert-unified2-alert.c at line 505, aun was not being freed

The patch below fixes this.

-Steve
15 years ago
Victor Julien 5f5a44b365 PPPoE fixes. 15 years ago
William Metcalf 82978f9f27 new pfring runmode for quad core, other small pfring fixes 15 years ago
Victor Julien 434da6b965 Set no reassembly flags on sessions we don't recognize the protocol for. 15 years ago
Gurvinder Singh f6b0c481b0 urilen support for engine 15 years ago
Victor Julien 9b4f3f918b Fix broken debug code in stream reassembly 15 years ago
Pablo Rincon c1e6aabb0a Small fix 15 years ago
Pablo Rincon 705471e4ee Adding single pattern matcher algorithms. If you cannot store a context for the patterns, use SpmSearch() macro. Adding unittests and stats 15 years ago
Victor Julien cae8e06cb9 Properly lock app layer result pool and add some debugging code for memory tracking. 15 years ago
Victor Julien 4284276b11 Merge applayer detect function into normal match function. Should speed up detection. 15 years ago
Victor Julien bcd0682150 Make engine startup a little less verbose. 15 years ago
Jason Ish 5076452707 Potential fix for issue 60.
- Increase the packet buffer so it can hold the link header when we
  have maximum size IP datagrams.
- Fix ip header length and pkt length calculation for re-assembled
  packets.
15 years ago
Victor Julien 9d3a9273dd Rename fmem_t to SCFmem and make sure it's not exported. 15 years ago
Pablo Rincon 673afeb4d3 fmemopen wrapper added (fix compilation problems on macosx and freebsd) 15 years ago
Victor Julien 42e8a01221 Make sure pcre PCRE_EXTRA_MATCH_LIMIT_RECURSION check works with strict compiler settings. 15 years ago
William Metcalf 5bde121754 --enable-gccprofile sets -pg flag detect presence of pcre recursion 15 years ago
Eric Leblond db2d483d11 convert action_type to enum
This patch converts packet action type to an enum. This will
provide some facilities and ease bad value detection by gcc.
15 years ago
Gerardo Iglesias Galvan f5743afed5 Fix logging messages related to icmp_id parsing 15 years ago
Gerardo Iglesias Galvan 4b39ddaf95 Fix logging messages related to icmp_id parsing 15 years ago
Breno Silva 1d055b0e09 ICMP Seq Rule Keyword 15 years ago
Victor Julien 34e11e4784 Fixup unused variable compiler warning in the dce code. 15 years ago
root ddf5995049 endianness handling update 15 years ago
Kirby Kuehl 3d59f40640 style patch 15 years ago
root 706bb95209 fix bug 61 15 years ago
Jason Ish 7aac64f262 unit test for issue 59. 15 years ago
Jason Ish a7b37afc4e Fix issue 59. Drop a fragment that extends past the maximum IP packet size. 15 years ago
Gurvinder Singh fea277b2aa memory leak fixes 15 years ago
Gurvinder Singh 5c8d90afc8 memory leak fixes 15 years ago
Gurvinder Singh 66cc392177 init b46 15 years ago
Kirby Kuehl 90b42232fa dcerpc request smb transact and fix for dcerpc bindack 15 years ago
Gurvinder Singh 8f00718b0d bug 57 15 years ago
Eric Leblond 51be576a30 nfq: modify queue length computation logic
This patch modifies  max queue length computation logic. The max queue
length was set to MAX_PENDING which is the total number of packet
processed simultaneously in suricata.

This value is correct but this will not permit to take all burst
effects into account (read sudden quantity of packet that arrives
faster than suricata is enable to parse). Furthermore there is a
delaying system when suricata gets overloaded which make necessary
to have packet storable into kernel for some time.

To improve this situation the patch increases the maximum queue
length to NFQ_BURST_FACTOR (4) time the MAX_PENDING packet and
it also increase the nfnetlink buffer size to be able to store
all packets waiting for suricata in the netlink receive buffer.
15 years ago
Eric Leblond 775ac9ad9d fix code file permission
detect-http-method.c was executable.
15 years ago
Eric Leblond 84dfc0172a gcc warning fixes.
This patch fixes gcc warning:
    warning: suggest braces around empty body in an ‘if’ statement
This was the case in  when the macro SCLogDebug was used:
    if (ssn != NULL)
        SCLogDebug("ssn->alproto %"PRIu16"", ssn->alproto);

It also fixes a signed-unsigned comparison.
15 years ago
Eric Leblond bda8702474 configure: compile with -Wextra
This patch modify CFLAGS to use -Wextra flag. To avoid problem
with "unused param" it disable this warning.
15 years ago
Eric Leblond 72d48f6658 nfq: add sanity checking
This patch adds sanity checking to payload handling. It set length
of packet to zero if an error occurs.
15 years ago
Eric Leblond 56cccdfa62 nfq: use switch instead of 'else if'
This patch convert a 'else if' serie to a switch to increase
the readability of the decision related code.

 Please enter the commit message for your changes. Lines starting
15 years ago
Eric Leblond c96586446b ethernet: use switch instead of 'else if'
This patch uses a switch instead of a 'else if' series. It also
adds a debug message for unsupported ethernet type.
15 years ago
Eric Leblond 6cf00d6204 Fix typo in Makefile.am
This patch fixes a typo in Makefile.am which was preventing
'make tags' from working.
15 years ago
Victor Julien 9295193968 Fixup unittest error output for RAW decoder. 15 years ago
William Metcalf c5d0b492d3 small unittest fixes to decode-raw.c 15 years ago
William Metcalf 8a64321340 raw pcap support additionl ipv4/6 validation 15 years ago
Pablo Rincon 0c9f51498a Small fixes at unittest helper functions and TestBidirec03 15 years ago