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

Warnint util 4516 v12.1 #7470

Closed
wants to merge 3 commits into from

Conversation

catenacyber
Copy link
Contributor

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

Describe changes:

  • Fix integer warnings -Wimplicit-int-conversion for detect*
  • Adds ci check for this warning

Final part of #7006 after #7351

Then remains only detect files to fix

Should this be split in multiple commits ?

@catenacyber catenacyber requested review from victorjulien and a team as code owners June 3, 2022 07:24
@catenacyber catenacyber mentioned this pull request Jun 3, 2022
@codecov
Copy link

codecov bot commented Jun 3, 2022

Codecov Report

Merging #7470 (3c95650) into master (51c7868) will increase coverage by 0.01%.
The diff coverage is 79.27%.

@@            Coverage Diff             @@
##           master    #7470      +/-   ##
==========================================
+ Coverage   75.71%   75.73%   +0.01%     
==========================================
  Files         655      655              
  Lines      188391   188399       +8     
==========================================
+ Hits       142635   142676      +41     
+ Misses      45756    45723      -33     
Flag Coverage Δ
fuzzcorpus 60.07% <73.95%> (+0.02%) ⬆️
suricata-verify 52.19% <70.17%> (+<0.01%) ⬆️
unittests 60.89% <76.02%> (+<0.01%) ⬆️

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

@suricata-qa
Copy link

ERROR:

ERROR: QA failed on report_failure.

ERROR: QA failed on tlpr1_asan_suri.

Pipeline 7671

@catenacyber
Copy link
Contributor Author

QA triggers debug assertion at detect-engine-content-inspection.c:531

(oops)

Copy link
Member

@victorjulien victorjulien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requested separate commits in a few places, the rest can be in a single commit

if (cd->flags & DETECT_CONTENT_DISTANCE && cd->distance > 0) {
dist = cd->distance;
SCLogDebug("distance to add: %u. depth + dist %u", dist, depth + dist);
}
SCLogDebug("depth %u + cd->within %u", depth, cd->within);
depth = cd->depth = depth + cd->within + dist;
if (depth + cd->within + dist < 0 ||
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like these to go into their own commit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, looks relevant

@@ -231,7 +231,11 @@ static int DetectAppLayerEventParseAppP2(DetectAppLayerEventData *data,
return -3;
}
}
data->event_id = event_id;
if (event_id > UINT8_MAX) {
SCLogWarning(SC_ERR_INVALID_SIGNATURE, "app-layer-event keyword's id has invalid value");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new error/warning condition, would like a separate commit here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@@ -1150,7 +1149,8 @@ static bool DetectRunTxInspectRule(ThreadVars *tv,
TRACE_SID_TXS(s->id, tx, "engine %p match %d", engine, match);
if (engine->stream) {
can->stream_stored = true;
can->stream_result = match;
// TODO change Callback prototype ?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes I think that makes sense, also in a separate commit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that makes a big commit...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(done in next version)

@@ -1021,7 +1021,7 @@ typedef struct HttpReassembledBody_ {
typedef struct SignatureNonPrefilterStore_ {
SigIntId id;
SignatureMask mask;
uint8_t alproto;
AppProto alproto;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this change the size of the struct? guess not if AppProto is uint16_t, but if it is an enum it would

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typedef uint16_t AppProto; ;-)

@catenacyber
Copy link
Contributor Author

Replaced by #7490

@catenacyber catenacyber closed this Jun 6, 2022
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.

3 participants