-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1c7f5c1
commit 1506738
Showing
1 changed file
with
7 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
* @impact Insecure Coding Practice | ||
* @repro.text This warning indicates that an NTSTATUS value is being explicitly cast to a Boolean type. This is likely to give undesirable results. For example, the typical success value for NTSTATUS, STATUS_SUCCESS, is false when tested as a Boolean. | ||
* @owner.email: [email protected] | ||
* @opaqueid CQLD-TODO | ||
* @opaqueid CQLD-C28714 | ||
* @problem.severity warning | ||
* @precision medium | ||
* @tags correctness | ||
|
@@ -20,9 +20,10 @@ | |
|
||
import cpp | ||
|
||
from Cast c, VariableAccess va | ||
|
||
from Conversion c | ||
where | ||
va.getTarget().getType().toString().matches("NTSTATUS") and | ||
c.getExplicitlyConverted().getType().toString().matches("BOOLEAN") and | ||
c.getExpr() = va | ||
select va, "Cast between semantically different integer types: NTSTATUS to Boolean" | ||
c.getUnconverted().getType().toString().matches("NTSTATUS") and | ||
c.getType().toString().matches("BOOLEAN") | ||
select c.getUnconverted(), "Cast between semantically different integer types: NTSTATUS to Boolean" | ||
|