Commit Graph

17968 Commits (2848061d0dfc26a2c5d68a75c32bc5c51caed228)
 

Author SHA1 Message Date
Victor Julien f48099edd3 detect/datasets: address format truncation warnings
detect-dataset.c: In function ‘SetupLoadPath’:
detect-dataset.c:391:9: error: ‘%s’ directive output may be truncated writing likely 1 or more bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]
  391 |     if (snprintf(path, sizeof(path), "%s/%s", dir, load) >= (int)sizeof(path)) // TODO windows path
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
detect-dataset.c:391:9: note: assuming directive output of 1 byte
detect-dataset.c:391:9: note: ‘snprintf’ output 2 or more bytes (assuming 4098) into a destination of size 4096

Ticket: #7905.
2 months ago
Victor Julien 14987dca35 detect/datarep: fix format truncation warning
detect-datarep.c: In function ‘SetupLoadPath’:
detect-datarep.c:262:9: error: ‘%s’ directive output may be truncated writing likely 1 or more bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]
  262 |     if (snprintf(path, sizeof(path), "%s/%s", dir, load) >= (int)sizeof(path)) // TODO windows path
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
detect-datarep.c:262:9: note: assuming directive output of 1 byte
detect-datarep.c:262:9: note: ‘snprintf’ output 2 or more bytes (assuming 4098) into a destination of size 4096
cc1: all warnings being treated as errors

Ticket: #7905.
2 months ago
Victor Julien 8630b29611 util/pidfile: address format truncation warning
util-pidfile.c: In function ‘SCPidfileCreate’:
util-pidfile.c:49:18: error: ‘%lu’ directive output may be truncated writing between 1 and 20 bytes into a region of size 16 [-Werror=format-truncation=]
   49 |     size_t len = snprintf(val, sizeof(val), "%"PRIuMAX"\n", (uintmax_t)getpid());
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
util-pidfile.c:49:18: note: using the range [0, 18446744073709551615] for directive argument
util-pidfile.c:49:18: note: ‘snprintf’ output between 3 and 22 bytes into a destination of size 16
   49 |     size_t len = snprintf(val, sizeof(val), "%"PRIuMAX"\n", (uintmax_t)getpid());
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Ticket: #7905.
2 months ago
Victor Julien 746823f3df github-actions: update rust checks to 1.90 2 months ago
Victor Julien ec418248d6 rust: update highest known rustc version to 1.90 2 months ago
Victor Julien 870b40220c rust: cargo update 2 months ago
Philippe Antoine f7f8fbc116 scripts: setup app layer rustfmt mod.rs last
Otherwise rustfmt complains that parser.rs does not exist yet
2 months ago
Philippe Antoine 096ba42ce9 detect/integers: add some meaningful error messages
To help rule writers
2 months ago
Philippe Antoine 4f7fc25a1a detect/dnp3: make dnp3.ind a generic uint16 bitflags keyword
Ticket: 6724

Allows operations such as negation
2 months ago
Philippe Antoine c1917dec21 detect/integers: make mqtt use generic detect_parse_uint_bitflags
Ticket: 6724
2 months ago
Philippe Antoine 867f5bfa21 detect/integers: generic detect_parse_uint_bitflags
Ticket: 6724

This will ease other keywords with bitflags, by having a generic
function + an association between flag string and bit value.
2 months ago
Cheng Longfei 9fb33bbaf6 lua: fix null dereference in tx HTTP accessor functions
Fix crashes in Lua when calling tx:response_line(), tx:request_line(),
tx:request_uri_raw(), or tx:request_host() on incomplete or malformed
HTTP transactions.

These functions return bstr pointers which may be NULL. Add NULL
checks before calling bstr_ptr() and bstr_len() to avoid segfaults.

Ticket: #7829
2 months ago
Victor Julien 48972d544c doc/userguide: link to protocol details from transactional rules 2 months ago
Victor Julien 480e664b4c doc/userguide: add xbits tx scope support
Ticket #7680.
2 months ago
Victor Julien a1c4167d94 doc/userguide: add initial protocols overview
Explain per protocol mechanics for rule matching.
2 months ago
Victor Julien 7034a17d1d doc/devguide: remove WIP mention of files in txs
Work has been completed, so comment is no longer accurate.
2 months ago
Victor Julien e2a5bc058c doc/userguide: fix DCERPC headings 2 months ago
Victor Julien be5c83ed53 doc/userguide: add rule hooks to protocol doc
Ticket #7662.
2 months ago
Victor Julien 91f258e2bc doc/userguide: add missing app-layer protocols 2 months ago
Victor Julien 2623e67a80 doc/userguide: add missing rule protocols 2 months ago
Philippe Antoine 3641b4eda1 detect/nfs: move nfs_procedure to rust
Make it able to use strings on the way

Ticket: 6723
2 months ago
Philippe Antoine 9869fb776b detect/snmp: pdu_type keyword now accepts strings
Ticket: 6723
2 months ago
Philippe Antoine 0553dfa814 detect/krb5: move krb5_msg_type to rust
Makes it a generic u32 on the way

Unit tests are covered by SV tests

Ticket: 6723
2 months ago
Adam Kiripolsky 5a4d280461 dpdk: fix assignment of pkt_mempools to ldev
Removed loop around assignment of pkt_mempools
to ldev_instance->dpdk_vars as it is not needed anymore.

Ticket: 7879
2 months ago
Philippe Antoine 24503b0ead rust: move file functions out of SuricataContext
Ticket: 7667
2 months ago
Philippe Antoine 1f084f8cb7 rust: move HttpRangeFreeBlock out of SuricataContext
Ticket: 7667
2 months ago
Philippe Antoine 828a6bdbf8 rust: bindgen SCLogMessage
Ticket: 7667
2 months ago
Philippe Antoine cc845dccdb rust: bindgen GenericVarFree
Ticket: 7667
2 months ago
Philippe Antoine b00788af8b rust: bindgen SCAppLayerParserTriggerRawStreamInspection
Ticket: 7667
2 months ago
Philippe Antoine c52121586a rust: move AppLayerEvents funcs out of RustContext
Ticket: 7667

just use it directly, with bindgen, and cfg not test
2 months ago
Philippe Antoine 2b419a5a26 src: clean includes for app-layer-events.h 2 months ago
Philippe Antoine bf6b8510fe rust: move DetectEngineStateFree out of RustContext
Ticket: 7667

just use it directly, with bindgen, and cfg not test
2 months ago
Philippe Antoine 573dd2367e rust: bindgen SCFileFlowFlagsToFlags
Ticket: 7667
2 months ago
Philippe Antoine 6fa85d18f0 rust: reenable lint unused_doc_comment
With just local exceptions
2 months ago
Philippe Antoine b59086210f rust: bindgen flow ffi API
Ticket: 7667
2 months ago
Philippe Antoine bbf1424371 rust: bindgen MpmAddPatternCI
Ticket: 7667
2 months ago
Philippe Antoine c391451f19 rust: begin to bindgen app-layer-register.h
Ticket: 7667
2 months ago
Philippe Antoine 95483228d2 detect: list-keywords cli shows integers with bitflags
Ticket: 7875
2 months ago
Philippe Antoine 53d9569dfb detect: list-keywords cli shows integers with enums
Ticket: 7875
2 months ago
Philippe Antoine da486af881 detect: list-keywords cli shows integers
Ticket: 7875
2 months ago
Philippe Antoine 68017d3fe1 detect: grow SigTableElmt flags to u32
to be later able to store information about keywords being about
integers
2 months ago
Philippe Antoine b298bce0e7 detect: list-keywords cli shows multi-buffers
Ticket: 7571
2 months ago
Andreas Dolp 37d748d441 doc: fix typo duplicate 'of'
Thanks to catenacyber
2 months ago
Andreas Dolp 375b5dd306 doc: fix typo /var/run/suricata in file permissions docs. 2 months ago
Andreas Dolp cc590b54c7 doc: fix typo and missing newline in rules/ssh_keywords. 2 months ago
Andreas Dolp 228abb7da0 doc: fix doc syntax error in rate_filter example. 2 months ago
Juliana Fajardini 21b27597d6 doc/rules/internals: minor fixes
Fix typo and add a reference about the classtype keyword effect.

Related to
Task #5449
2 months ago
Fupeng Zhao e79d735374 decode/etag: ETag 802.1BR decoder
Ticket: #3953.
2 months ago
Philippe Antoine cb9ab951b9 detect/integers: subslice for multi-integers 2 months ago
Philippe Antoine 82f0e725a2 detect/integers: index or_absent and or_oob
To match if array is empty, or index is out of bounds
2 months ago