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

NPE in AGREE validator checkNamedElement(NamedElement) #80

Closed
kfhoech opened this issue Mar 1, 2022 · 2 comments · Fixed by #85
Closed

NPE in AGREE validator checkNamedElement(NamedElement) #80

kfhoech opened this issue Mar 1, 2022 · 2 comments · Fixed by #85
Assignees
Labels
AGREE bug Something isn't working
Milestone

Comments

@kfhoech
Copy link
Contributor

kfhoech commented Mar 1, 2022

In the AgreeValidator.checkNamedElement(NamedElement) at the line

if (namedEl.getName().equals(feat.getName())) {

the call to getName() on namedEl may result in a null value generating an NPE on the .equals(...)

@kfhoech kfhoech added bug Something isn't working AGREE labels Mar 1, 2022
@kfhoech kfhoech added this to the v2.9.0 milestone Mar 1, 2022
@kfhoech kfhoech self-assigned this Mar 4, 2022
@kfhoech
Copy link
Contributor Author

kfhoech commented Mar 4, 2022

The root of the problem is that NamedSpecStatements such as AssumeStatement, GuaranteeStatement, AssertStatement, LemmaStatement, and ReachableStatement are optionally named.

The fix for this issue, however, is quick. Since it is allowed for multiple such statements to be unnamed (that is, a null name), simply check that the name is not null before comparing to other names.

@kfhoech
Copy link
Contributor Author

kfhoech commented Mar 4, 2022

Resolved by #85

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AGREE bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant