danielealbano / cachegrand

cachegrand - a modern data ingestion, processing and serving platform built for today's hardware
BSD 3-Clause "New" or "Revised" License
975 stars 34 forks source link

Use an uintptr_t to calculate the offset of the network_channel_t #361

Closed danielealbano closed 1 year ago

danielealbano commented 1 year ago

This PR fixes the security warning https://github.com/danielealbano/cachegrand/security/code-scanning/442 .

Although the pointer math is required, it switches to use an uintptr_t to calculate an offset, then to acquire the pointer to the channel 0 and then to calculate the pointer to the desired network_channel object.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.07 :warning:

Comparison is base (d2abb02) 79.01% compared to head (1aa729a) 78.94%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #361 +/- ## ========================================== - Coverage 79.01% 78.94% -0.07% ========================================== Files 182 182 Lines 12544 12546 +2 ========================================== - Hits 9911 9904 -7 - Misses 2633 2642 +9 ``` | Flag | Coverage Δ | | |---|---|---| | unittests | `78.94% <100.00%> (-0.07%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://codecov.io/gh/danielealbano/cachegrand/pull/361?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano) | Coverage Δ | | |---|---|---| | [src/worker/network/worker\_network\_iouring\_op.c](https://codecov.io/gh/danielealbano/cachegrand/pull/361?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano#diff-c3JjL3dvcmtlci9uZXR3b3JrL3dvcmtlcl9uZXR3b3JrX2lvdXJpbmdfb3AuYw==) | `64.77% <100.00%> (+0.40%)` | :arrow_up: | ... and [5 files with indirect coverage changes](https://codecov.io/gh/danielealbano/cachegrand/pull/361/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano) Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.