Pass SigMatch pointer instead of a list id to SigParseRequiredContentSize.
uint64_t needed;
if (bsize >= 0) {
int len, offset;
- SigParseRequiredContentSize(s, bsize, list, &len, &offset);
+ SigParseRequiredContentSize(s, bsize, s->init_data->smlists[list], &len, &offset);
SCLogDebug("bsize: %d; len: %d; offset: %d [%s]", bsize, len, offset, s->sig_str);
needed = len;
if (len > bsize) {
* - Negated content values are checked but not accumulated for the required size.
*/
void SigParseRequiredContentSize(
- const Signature *s, const int max_size, int list, int *len, int *offset)
+ const Signature *s, const int max_size, const SigMatch *sm, int *len, int *offset)
{
- if (list > (int)s->init_data->smlists_array_size) {
- return;
- }
-
- SigMatch *sm = s->init_data->smlists[list];
int max_offset = 0, total_len = 0;
bool first = true;
for (; sm != NULL; sm = sm->next) {
void DetectContentPatternPrettyPrint(const DetectContentData *cd, char *str, size_t str_len);
void SigParseRequiredContentSize(
- const Signature *s, const int max, int list, int *len, int *offset);
+ const Signature *s, const int max, const SigMatch *sm, int *len, int *offset);
#endif /* __DETECT_CONTENT_H__ */
}
int total_length, offset;
- SigParseRequiredContentSize(s, dsize, DETECT_SM_LIST_PMATCH, &total_length, &offset);
+ SigParseRequiredContentSize(
+ s, dsize, s->init_data->smlists[DETECT_SM_LIST_PMATCH], &total_length, &offset);
SCLogDebug("dsize: %d len: %d; offset: %d [%s]", dsize, total_length, offset, s->sig_str);
if (total_length > dsize) {