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

Fix incomplete operation errors #534

Merged
merged 2 commits into from
Mar 14, 2024
Merged

Conversation

smeyer198
Copy link
Contributor

IncompleteOperationErrors are reported, if the a dataflow path does not end in an accepting state. However, if there are multiple dataflow paths, multiple IncompleteOperationErrors are reported, although some paths lead to an accepting state. For example, for

Cipher c = Cipher.getInstance([...]);
c.init([...]);
if (Math.random() > 0.5) {
    c.doFinal([...]);
}

the analysis reports an error at the call to init with the info that a call to doFinal is missing, and it reports an error at the call to doFinal with the info that a call to doFinal is missing. The second error is not quite correct because doFinal is called on the corresponding dataflow path. Hence, this is a false positive.
This PR adds the logic for reporting the errors only on the correct positions (here at init) and adds the information that there is a potential dataflow path, where a call to doFinal is missing. This holds also for loops.

Fixes #51

@schlichtig schlichtig merged commit ffc1e7f into develop Mar 14, 2024
8 checks passed
@smeyer198 smeyer198 deleted the fix/incomplete_operation_errors branch March 14, 2024 20:24
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.

IncompleteOperationErrors are imprecise
2 participants