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

util: fix -Wshorten-64-to-32 warnings #12481

Closed
wants to merge 1 commit into from

Conversation

catenacyber
Copy link
Contributor

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

Describe changes:

  • fix -Wshorten-64-to-32 warnings for some files : util

Some commits of #9840
#11952 next batch

Still to do afterwards :

  • detect
  • CI check

Copy link

codecov bot commented Jan 26, 2025

Codecov Report

Attention: Patch coverage is 69.67213% with 37 lines in your changes missing coverage. Please review.

Project coverage is 80.54%. Comparing base (d63ad75) to head (3dffc34).
Report is 44 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12481      +/-   ##
==========================================
+ Coverage   80.52%   80.54%   +0.01%     
==========================================
  Files         923      923              
  Lines      259176   259204      +28     
==========================================
+ Hits       208708   208778      +70     
+ Misses      50468    50426      -42     
Flag Coverage Δ
fuzzcorpus 56.15% <47.54%> (+0.09%) ⬆️
livemode 19.38% <20.49%> (-0.04%) ⬇️
pcap 44.19% <45.08%> (+<0.01%) ⬆️
suricata-verify 63.30% <49.18%> (-0.03%) ⬇️
unittests 58.45% <42.62%> (-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 24364

@@ -148,16 +148,16 @@ static int ReadFn(void *handler, char *buf, int size)
*/
static int WriteFn(void *handler, const char *buf, int size)
{
size_t count = 0;
int count = 0;
SCFmem *mem = handler;
size_t available = mem->size - mem->pos;
Copy link
Member

Choose a reason for hiding this comment

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

where is checked that his result fits an int?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

while (count < size) where size is an int from the function prototype

@catenacyber catenacyber marked this pull request as draft January 30, 2025 14:52
@catenacyber
Copy link
Contributor Author

Setting as draft as I cannot set changes requested to myself

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.

@catenacyber fixed

@catenacyber
Copy link
Contributor Author

Next in #12534

@catenacyber catenacyber closed this Feb 6, 2025
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