-
Notifications
You must be signed in to change notification settings - Fork 806
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
Unsafe type assertion #772
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In line 76
value
may have type different from '*bool'.The type assertion assumes that value is not zero and that value stores a value of type
*bool,
otherwise the command will cause panic. If value is checked for zero in line 73, then apparently a check for the *bool type is performed in line 76, but such a check is incorrect, because it will cause panic if the value type does not match the*bool
type.I think it would be safer to use the following construction:
if _, ok :=value.(*bool); ok { ... }
Found by Linux Verification Center (portal.linuxtesting.ru) with SVACE.
Author A. Burke.
The text was updated successfully, but these errors were encountered: