Literals shouldn't need to be NULL-terminated.
- Dominant language
- C++
- Stars
- 5.5k
- Forks
- 816
- Avg merge
- 4d 21h
- Merged PRs (30d)
- 2
Description
The [documentation for hs_compile_lit()](https://intel.github.io/hyperscan/dev-reference/api_files.html#c.hs_compile_lit) states that an expression must be NULL-terminated even though its length must be supplied. Looking though `hs_compile_lit_multi_int()` I see that nothing after the declared length is used by
https://github.com/intel/hyperscan/blob/64a995bf445d86b74eb0f375624ffc85682eadfe/src/hs.cpp#L362-L364
However, there follows a call to
https://github.com/intel/hyperscan/blob/64a995bf445d86b74eb0f375624ffc85682eadfe/src/hs.cpp#L373-L374
then
https://github.com/intel/hyperscan/blob/64a995bf445d86b74eb0f375624ffc85682eadfe/src/parser/logical_combination.cpp#L143-L144
and finally
https://github.com/intel/hyperscan/blob/64a995bf445d86b74eb0f375624ffc85682eadfe/src/hs.cpp#L530-L536
Given that the documentation explicitly allows for `\0` to appear in the expression it seems like there is some further bug here, perhaps the absence of a `hs_expression_lit_info()`.
See also #205.
Contributor guide
Assessment
This issue has not been assessed yet.