Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

var: Use 16-bit container for type #12368

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

jlucovsky
Copy link
Contributor

Continuation of #12356

Issue: 6855: Match sigmatch type field in var and bit structs

Align the size and datatype of type, idx, and next members across:

  • FlowVarThreshold
  • FlowBit
  • FlowVar
  • GenericVar
  • XBit
  • DetectVarList

Note that the FlowVar structure has been intentionally constrained to match the structure size prior to this commit. To achieve this, the keylen member was restricted to 8 bits after it was confirmed its value is checked against a max of 0xff.

Link to ticket: https://redmine.openinfosecfoundation.org/issues/6855

Describe changes:

  • Increase type in flowbit, flowvar and generic var
  • Ensure type, idx, and next pointers align on each struct.

Updates:

  • CI fix -- int variable was assigned to uint16_t

Provide values to any of the below to override the defaults.

  • To use an LibHTP, Suricata-Verify or Suricata-Update pull request,
    link to the pull request in the respective _BRANCH variable.
  • Leave unused overrides blank or remove.

SV_REPO=
SV_BRANCH=
SU_REPO=
SU_BRANCH=
LIBHTP_REPO=
LIBHTP_BRANCH=

Issue: 6855: Match sigmatch type field in var and bit structs

Align the size and datatype of type, idx, and next members across:
- FlowVarThreshold
- FlowBit
- FlowVar
- GenericVar
- XBit
- DetectVarList

Note that the FlowVar structure has been intentionally constrained to
match the structure size prior to this commit. To achieve this, the
keylen member was restricted to 8 bits after it was confirmed its value
is checked against a max of 0xff.
This commit corrects an error message displayed when the key length is
out of range.
Copy link

codecov bot commented Jan 9, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 82.50%. Comparing base (494d7bf) to head (30fbca4).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12368      +/-   ##
==========================================
- Coverage   82.54%   82.50%   -0.05%     
==========================================
  Files         912      912              
  Lines      258028   258028              
==========================================
- Hits       212988   212884     -104     
- Misses      45040    45144     +104     
Flag Coverage Δ
fuzzcorpus 60.56% <0.00%> (-0.16%) ⬇️
livemode 19.42% <0.00%> (+0.03%) ⬆️
pcap 44.40% <0.00%> (-0.03%) ⬇️
suricata-verify 63.20% <50.00%> (+0.01%) ⬆️
unittests 58.11% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 24148

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants