-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
rust-hyperscan/hyperscan/src/compile/pattern.rs
Lines 141 to 152 in e2471ff
| pub struct Pattern { | |
| /// The expression to parse. | |
| pub expression: String, | |
| /// Flags which modify the behaviour of the expression. | |
| pub flags: Flags, | |
| /// ID number to be associated with the corresponding pattern in the expressions array. | |
| pub id: Option<usize>, | |
| /// Extended behaviour for this pattern | |
| pub ext: ExprExt, | |
| /// The precision to track start of match offsets in stream state. | |
| pub som: Option<SomHorizon>, | |
| } |
the id field in Pattern is usize, but it's c_uint / u32 in the hs_compile_multi and match_event_handler
rust-hyperscan/hyperscan-sys/src/hyperscan.rs
Lines 464 to 474 in e2471ff
| pub fn hs_compile_multi( | |
| expressions: *const *const ::libc::c_char, | |
| flags: *const ::libc::c_uint, | |
| ids: *const ::libc::c_uint, | |
| elements: ::libc::c_uint, | |
| mode: ::libc::c_uint, | |
| platform: *const hs_platform_info_t, | |
| db: *mut *mut hs_database_t, | |
| error: *mut *mut hs_compile_error_t, | |
| ) -> hs_error_t; | |
| } |
rust-hyperscan/hyperscan-sys/src/hyperscan.rs
Lines 558 to 566 in e2471ff
| pub type match_event_handler = ::core::option::Option< | |
| unsafe extern "C" fn( | |
| id: ::libc::c_uint, | |
| from: ::libc::c_ulonglong, | |
| to: ::libc::c_ulonglong, | |
| flags: ::libc::c_uint, | |
| context: *mut ::libc::c_void, | |
| ) -> ::libc::c_int, | |
| >; |
if pattern.id > u32.Max, it will be truncated while compiling database, and then the callback id will be wrong.
Metadata
Metadata
Assignees
Labels
No labels