Commit Graph

36 Commits (ad2c136e8ff4bf223e8c454cb46bb563ebf58f1c)

Author SHA1 Message Date
Pablo Rincon ad2c136e8f Renaming errors (naming conventions) 16 years ago
Victor Julien 2481f2102b Add missing return value evaluation in port parsing and fix broken unittest. 16 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
16 years ago
Victor Julien b7bac14040 Fixup code to compile with -Wall -Werror -Wextra -Wno-unused-parameter compiler options. 16 years ago
Victor Julien 0ab9adabd4 Test PortTestMatchDoubleNegation is no longer expected to fail. 16 years ago
Victor Julien 50c07f9901 Fix wrong negation of ports. 16 years ago
Victor Julien 53041eeb67 Small cleanups. 16 years ago
Anoop Saldanha f8edb74439 double port/address negation is parsed incorrectly 16 years ago
Victor Julien ecf86f9c23 Rename to Suricata. 16 years ago
Victor Julien 2cfa284999 Fix app layer detect to actually work. 16 years ago
Victor Julien 746d12071e Fix merge artifacts. 16 years ago
William Metcalf 0db1d01b0c port space negation notification 16 years ago
Anoop Saldanha bb8a84d967 todo comment update for address and port parsing 16 years ago
Victor Julien 171edda02a Fix compilation of address and port error messages in debug mode. 16 years ago
Anoop Saldanha dc44700ce5 Support vars lookup from conf file. Current patch support address and port group vars lookup 16 years ago
Victor Julien 83d1e283bb Improve message on test expected to fail at this point. 16 years ago
Pablo Rincon 0df58406ee Adding Unittests, doxygen comments, coding style, logging support 16 years ago
Victor Julien 15ab5d7003 More engine init memleaks fixed. HashListTable remove function fixed. 16 years ago
Victor Julien fbe87a3ad5 Bunch of mostly unittest related memleak fixes. 16 years ago
Victor Julien 4e848796d8 Use correct free function in DetectPortParseInsertString. 16 years ago
Anoop Saldanha 0815ed7c9e Some refactoring of the code, error handling done 16 years ago
William Metcalf 67e6cf21ae verify valid port range 16 years ago
Victor Julien 5ffb7a7bd7 Add a few more tests for portrange validation. 16 years ago
Breno Silva c43319c337 Regular expression for UnitTests
Signed-off-by: Brian Rectanus <brectanu@gmail.com>
16 years ago
Victor Julien 968d8df12b More logging API usage. Changed logging macro's slightly so the vars inside them won't conflict with vars used by the calling function. 16 years ago
Victor Julien 4cc24fe463 Improve the handling of addresses and ports. Properly detect !any, other full negation. Fix [80:!80] syntax errors being undetected. 16 years ago
Victor Julien 6eaff4be12 Fixes for issues found by static code analyzer. 16 years ago
Victor Julien 5501212e62 Fix sizeof printf related compiler warnings. 16 years ago
Brian Rectanus fa5939ca91 64 bit cleanup part2 16 years ago
Victor Julien 5df5b35e90 Put all globals in the detection engine ctx. Add HashList type, a hash that also stores the items ina list to it can be traversed. Many cleanups. 16 years ago
Victor Julien ec39f5446c Fix rule tree update. Fix bloomfilter error in b2g. 16 years ago
Victor Julien efb10fc0d6 big update 16 years ago
Victor Julien 0250642cc0 Fix negated variables, add tests. 16 years ago
Victor Julien 724d942688 Fix port check. 16 years ago
Victor Julien 3f7195454b Big detection engine update. 16 years ago
Victor Julien 8b3d06fd92 Rename some detection engine related files. 16 years ago