Skip to content

Avoid a potential CCE in Position.equals#945

Merged
JonasKlauke merged 2 commits intosoot-oss:developfrom
marcus-h:fix-potential-cce
Jun 6, 2024
Merged

Avoid a potential CCE in Position.equals#945
JonasKlauke merged 2 commits intosoot-oss:developfrom
marcus-h:fix-potential-cce

Conversation

@marcus-h
Copy link
Copy Markdown
Collaborator

@marcus-h marcus-h commented Jun 6, 2024

The old code in sootup.core.model.Position.equals always casts the passed argument to a FullPosition. However, in theory, it is possible that there are multiple subclasses of Position. Hence, the cast could potentially result in a CCE. In order to avoid this, just cast the passed argument to Position itself, which is always safe (due to the previous checks).

The old code in sootup.core.model.Position.equals always casts the passed
argument to a FullPosition. However, in theory, it is possible that there
are multiple subclasses of Position. Hence, the cast could potentially
result in a CCE. In order to avoid this, just cast the passed argument to
Position itself, which is always safe (due to the previous checks).
@JonasKlauke JonasKlauke merged commit 2e71069 into soot-oss:develop Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants