Skip to content

C++: Limit flow through sinks and sources in cpp/upcast-array-pointer-arithmetic #19434

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

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

Conversation

jketema
Copy link
Contributor

@jketema jketema commented Apr 30, 2025

No description provided.

@github-actions github-actions bot added the C++ label Apr 30, 2025
@jketema jketema added the no-change-note-required This PR does not need a change note label Apr 30, 2025
@jketema jketema marked this pull request as ready for review April 30, 2025 22:21
@Copilot Copilot AI review requested due to automatic review settings April 30, 2025 22:21
@jketema jketema requested a review from a team as a code owner April 30, 2025 22:21
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refines the CastArrayPointerArithmetic dataflow query by preventing flow through both source and sink nodes and updates the expected test outputs accordingly.

  • Added isBarrierIn and isBarrierOut predicates to treat sources and sinks as barriers in the dataflow config.
  • Removed obsolete expected edges and subpaths from the test output to match the new barrier behavior in CastArrayPointerArithmetic.expected.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
cpp/ql/src/Likely Bugs/Conversion/CastArrayPointerArithmetic.ql Defined source and sink nodes as barriers (isBarrierIn/isBarrierOut)
cpp/ql/test/query-tests/Likely Bugs/Conversion/CastArrayPointerArithmetic/CastArrayPointerArithmetic.expected Removed expected edges and subpaths that are now blocked by the new barrier logic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant