Open
Conversation
Even if current caller does not provide too big data. Ticket: 8001
To be able to load 1M signatures and not have a stack overflow Ticket: 8001
To avoid stack overflow A single signature should not have more than 65k buffers Ticket: 8001
buffer_type_id is a u32 Ticket: 8001
Closed
|
Information: QA ran without warnings. Pipeline = 29258 |
victorjulien
reviewed
Feb 4, 2026
| if (add_ts || add_tc) { | ||
| types[a->sm_list] = a->type; | ||
| engines[a->sm_list][engines_idx[a->sm_list]++] = a->frame_v1.alproto; | ||
| engines[g_alproto_max * a->sm_list + engines_idx[a->sm_list]++] = a->frame_v1.alproto; |
Member
There was a problem hiding this comment.
this is hard for me to read... why are we multiplying by g_alproto_max. This should be constant at his point, right?
Contributor
Author
There was a problem hiding this comment.
This should be constant at this point, right?
Yes, but you did not like the C syntax for allocating bidimensional arrays in the previous PR version.
Any suggestion ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to ticket: https://redmine.openinfosecfoundation.org/issues/
https://redmine.openinfosecfoundation.org/issues/8001
Describe changes: improve stack allocations
#14669 with scan-build fix without bidimensional array
Still todo after : handle other cases of
git grep '\];' src/*.c | grep -v = | grep -v '[0-9]\];' | grep -v '[A-Z]\];' | grep -v return | grep -v g_alproto_max | grep -v '\[\];' | grep -v sizeofafter src/detect-engine.c