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

user-jakobl-CodeQL-Testing #860

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.c
Expand Up @@ -34,6 +34,21 @@ Module Name:
#pragma alloc_text (PAGE, DriverUnload)
#endif

// CodeQL Injected Defect #1:
int foo1(int n1, unsigned short delta) {
return n1 + delta < n1; // BAD

Check failure

Code scanning / CodeQL

Signed overflow check

Testing for signed overflow may produce undefined results.
}

// CodeQL Injected Defect #2:
int foo2(int n1, unsigned short delta) {
return n1 + delta < n1; // BAD

Check failure

Code scanning / CodeQL

Signed overflow check

Testing for signed overflow may produce undefined results.
}

// CodeQL Injected Defect #3:
int foo3(int n1, unsigned short delta) {
return n1 + delta < n1; // BAD

Check failure

Code scanning / CodeQL

Signed overflow check

Testing for signed overflow may produce undefined results.
}

NTSTATUS
DriverEntry(
_In_ PDRIVER_OBJECT DriverObject,
Expand Down