Philippe Antoine
bedd48596f
ci: run clippy on test code as well
3 years ago
Philippe Antoine
259cdf169e
rust: fix single_binding
...
error: this match could be written as a `let` statement
--> src/nfs/nfs3_records.rs:747:9
|
747 | / match result {
748 | | (r, request) => {
749 | | assert_eq!(r.len(), 0);
750 | | assert_eq!(request.handle, expected_handle);
751 | | assert_eq!(request.name_vec, br#"bln"#);
752 | | }
753 | | }
| |_________^
3 years ago
Philippe Antoine
b141eb9f11
rust: fix single_match
...
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
--> src/http2/parser.rs:882:17
|
882 | / match ctx.value {
883 | | Some(_) => {
884 | | panic!("Unexpected value");
885 | | }
886 | | None => {}
887 | | }
| |_________________^
3 years ago
Philippe Antoine
9a84681bd9
rust: fix vec_init_then_push
...
warning: calls to `push` immediately after creation
--> src/pgsql/parser.rs:1179:9
|
1179 | / let mut database_param: Vec<PgsqlParameter> = Vec::new();
1180 | | database_param.push(database);
| |______________________________________^
help: consider using the `vec![]` macro: `let database_param: Vec<PgsqlParameter> = vec![..];`
3 years ago
Philippe Antoine
85329f5351
rust: fix zero_prefixed_literal
...
warning: this is a decimal constant
--> src/mqtt/parser.rs:888:19
|
888 | 0x00, 06, /* Topic Length: 6 */
| ^^
|
3 years ago
Philippe Antoine
a8199bf2ca
rust: fix assertions_on_constants for assert!(false)
...
using panic! instead with a string message
3 years ago
Philippe Antoine
c49463c86f
rust: fix assertions_on_constants for assert!(true)
...
Which will be optimized away by the compiler
3 years ago
Gleb Smirnoff
b239e88c93
ipfw: close(2) instead shutdown(2) of the divert(4) socket
...
The shutdown(2) syscall would always return ENOTCONN for FreeBSD 11,
FreeBSD 12, FreeBSD 13 and FreeBSD 14. It could do some action on the
socket in the kernel in FreeBSD 10 and before, did not test.
3 years ago
Philippe Antoine
adf5e6da7b
detect: strip_pseudo_headers transform
...
Ticket: 6546
3 years ago
Victor Julien
1dcf69b211
eve/http: add location header independent of status availability
3 years ago
Victor Julien
9a14d7a723
eve/http: use numeric status code by default
...
To avoid costly string operations.
3 years ago
Victor Julien
f5565f42e7
eve/email: improve logging binary data
...
Use jb_append_string_from_bytes() as it works better than
BytesToString+jb_append_string when logging binary data.
Bug: #6664 .
3 years ago
Victor Julien
609cac58b7
flow: minor optimization
...
Most of the time FlowGetFlowFromHash will succeed.
3 years ago
Victor Julien
75c1b7fb10
detect: consolidate per rule group file loops
...
Don't loop multiple times over the per group sig array.
3 years ago
Victor Julien
3b8ed937d7
detect: remove DCERPC mask logic
...
Added nothing over alproto check already in place.
3 years ago
Victor Julien
44a8bf463e
detect/rule-header: use bool type
...
Update frame prototype as well, to match already returned true/false values.
3 years ago
Victor Julien
72841be050
detect/rule-header: minor code cleanups
3 years ago
Victor Julien
5c6089f93f
detect/address: refactor match array building
3 years ago
Victor Julien
7b2d6b6894
detect/address: minor cleanup
3 years ago
Victor Julien
96aee6434f
mpm/ac: pointer hygene
3 years ago
Victor Julien
aad403d87d
mpm/hs: improve pointer hygene
3 years ago
Victor Julien
11bf60aa3a
detect/mpm: minor cleanup
3 years ago
Victor Julien
db2484276e
detect: shrink sgh to have all runtime members on one cache line
3 years ago
Victor Julien
91f153fb1d
detect: constify flow flags in tx rule inspect
3 years ago
Victor Julien
e4550bee0a
detect: minor cleanup for rule group get function
3 years ago
Victor Julien
fd4ca53eb7
app-layer: micro optimization for AppProtoEquals
...
Add most common condition first.
3 years ago
Victor Julien
88cc999184
detect/bsize: constify keyword args during size check
3 years ago
Victor Julien
e06d2c402a
detect/content: limits prop comment cleanup
3 years ago
Victor Julien
4f0f7b1969
detect/dsize: minor code cleanup
3 years ago
Victor Julien
2b3ec34de8
detect: use do { } while loop for app engine loop
3 years ago
Victor Julien
2911656d6c
detect/content: fix offset for negative distance
...
Fix offset calculation on sigs with negative distance. Can lead to FN
in certain cases.
Bug: #6661 .
3 years ago
Victor Julien
18eafb622f
detect/content-inspect: add more tests
3 years ago
Victor Julien
0172c01dc2
spm/bm: minor code cleanups; constification
3 years ago
Victor Julien
4a6a3dc296
mpm: UNITTESTS guard for RegisterUnittests func
3 years ago
Victor Julien
ea5cf44fc2
mpm: remove unused flags field
3 years ago
Victor Julien
4558c5c515
detect/http_server_body: modernize test
3 years ago
Victor Julien
bd66504a43
detect: implement --qa-skip-prefilter
...
Option meant for testing performance of rule engine w/o prefilter
optimizations.
3 years ago
Victor Julien
222dcf776e
detect/content-inspect: add negation tests
...
Test mixing of negation, endswith and depth.
3 years ago
Victor Julien
fd75aca1a1
detect/bytetest: remove unused Match function
...
All matching is done as part of content inspection.
3 years ago
Victor Julien
f2e9c258c4
detect/pcre: remove unused match member
...
pcre2_match_data is created per thread when needed.
3 years ago
Victor Julien
3e8db97687
detect/bytemath: fix u32 buffer size logic
...
Remove u16 cast. Remove debug assert for u16 size.
In 83ed2c3b97 the input was changed to
u32
3 years ago
Victor Julien
eca6639a82
detect/pcre: localize match limit option parsing
...
No need to put it into a per ctx flag.
3 years ago
Victor Julien
18dfa69364
detect/pcre: remove unused opts field
3 years ago
Victor Julien
9dc35fbd00
detect/pcre: put commonly used members on first cache line
3 years ago
Victor Julien
e3f2b3418a
detect/content-inspect: use of replace keyword is rare
...
Hint compiler about this.
3 years ago
Victor Julien
bcb2b50cfc
detect/profiling: improve pcap reading performance
...
When reading a pcap, packet time can move much faster than wall
clock time. This would trigger many more profile syncs than before.
As the sync is using a lock to synchronize with other threads, this
is an expensive operation.
Bug: #6619 .
Fixes: b591813b86 ("profiling/rules: reduce sync logic scope")
3 years ago
Juliana Fajardini
8d3de85edd
pgsql: fix u16 overflow in query data_row
...
Found by oss-fuzz with quadfuzz.
Cf https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=63113
According to PostgreSQL documentation the maximum number of rows can be
the maximum of tuples that can fit onto max u32 pages - 4,294,967,295 (cf
https://www.postgresql.org/docs/current/limits.html ). Some rough
calculations for that indicate that this could go over max u32, so
updating the data_row data type to u64.
Bug #6389
3 years ago
Philippe Antoine
4933b817aa
doc: fix byte_test examples
...
As this keyword has 4 mandatory arguments, and some examples
had only three...
Ticket: 6629
3 years ago
Juliana Fajardini
a37fa62710
devguide: explain example-rule container usage
...
Have these options documented, so that whoever writes rule-related
documentation can easily know what they could use to make the doc look
better.
3 years ago
Philippe Antoine
d3218385e9
detect: case-insensitive comparison for requires
...
Ticket: 6656
3 years ago