You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@tsfile.apache.org by "HTHou (via GitHub)" <gi...@apache.org> on 2024/11/05 08:19:25 UTC

[PR] Fix code scanning alert no. 5: Unsigned difference expression compared to zero [tsfile]

HTHou opened a new pull request, #288:
URL: https://github.com/apache/tsfile/pull/288

   Fixes [https://github.com/apache/tsfile/security/code-scanning/5](https://github.com/apache/tsfile/security/code-scanning/5)
   
   To fix the problem, we need to ensure that the comparison correctly reflects the intended logic without relying on the properties of unsigned integers. Since the intention seems to be to check if there are remaining bytes to process, we can replace the relational comparison with an equality check. This avoids the potential pitfalls of unsigned arithmetic.
   
   - Change the comparison `filter_data_bytes_len - word_idx * 8 > 0` to `filter_data_bytes_len > word_idx * 8`.
   - This change ensures that we are directly comparing the two unsigned values without performing a subtraction that could lead to confusion or errors.
   
   
   _Suggested fixes powered by Copilot Autofix. Review carefully before merging._
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@tsfile.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix code scanning alert no. 5: Unsigned difference expression compared to zero [tsfile]

Posted by "jt2594838 (via GitHub)" <gi...@apache.org>.
jt2594838 merged PR #288:
URL: https://github.com/apache/tsfile/pull/288


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@tsfile.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix code scanning alert no. 5: Unsigned difference expression compared to zero [tsfile]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #288:
URL: https://github.com/apache/tsfile/pull/288#issuecomment-2456544691

   ## [Codecov](https://app.codecov.io/gh/apache/tsfile/pull/288?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   Attention: Patch coverage is `0%` with `1 line` in your changes missing coverage. Please review.
   > Project coverage is 63.63%. Comparing base [(`6c4f911`)](https://app.codecov.io/gh/apache/tsfile/commit/6c4f911f04b78f453adf935b8ab95209c0e1058a?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`6dd5bfd`)](https://app.codecov.io/gh/apache/tsfile/commit/6dd5bfdf3113357ada6f3cac6191129ec577c957?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/tsfile/pull/288?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [cpp/src/reader/bloom\_filter.cc](https://app.codecov.io/gh/apache/tsfile/pull/288?src=pr&el=tree&filepath=cpp%2Fsrc%2Freader%2Fbloom_filter.cc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y3BwL3NyYy9yZWFkZXIvYmxvb21fZmlsdGVyLmNj) | 0.00% | [0 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/tsfile/pull/288?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@           Coverage Diff            @@
   ##           develop     #288   +/-   ##
   ========================================
     Coverage    63.63%   63.63%           
   ========================================
     Files          501      501           
     Lines        31787    31787           
     Branches      4110     4110           
   ========================================
     Hits         20228    20228           
     Misses       11082    11082           
     Partials       477      477           
   ```
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/tsfile/pull/288?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@tsfile.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org