summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJakob Lichtenberg (170957) <[email protected]>2023-02-07 19:54:42 -0800
committerJakob Lichtenberg (170957) <[email protected]>2023-02-07 19:54:42 -0800
commitf4180517074a64b0127f34e834e914f646f5186a (patch)
tree4be49ac79f0c22f3a10d83ae6a25a82e2c06c259 /tools
parent602ca8ed80ec21462335bfd04b67353ecd3e33d5 (diff)
user-jakobl-CodeQL-Testinguser-jakobl-CodeQL-Testing
Diffstat (limited to 'tools')
-rw-r--r--tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.c b/tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.c
index 19f27900..9dc9e91f 100644
--- a/tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.c
+++ b/tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.c
@@ -34,6 +34,21 @@ Environment:
#pragma alloc_text (PAGE, DriverUnload)
#endif
+// CodeQL Injected Defect #1:
+int foo1(int n1, unsigned short delta) {
+ return n1 + delta < n1; // BAD
+}
+
+// CodeQL Injected Defect #2:
+int foo2(int n1, unsigned short delta) {
+ return n1 + delta < n1; // BAD
+}
+
+// CodeQL Injected Defect #3:
+int foo3(int n1, unsigned short delta) {
+ return n1 + delta < n1; // BAD
+}
+
NTSTATUS
DriverEntry(
_In_ PDRIVER_OBJECT DriverObject,
@@ -121,22 +136,10 @@ DispatchCreate (
PAGED_CODE();
- // Injected defects for testing CodeQL CI:
- unsigned long x=42;
- unsigned long y=43;
- unsigned long long z;
-
- // Injected defects #1:
- z = x*y;
-
- // Injected defects #2:
- z = x*y;
-
- // Injected defects #3:
- z = x*y;
ExFreePool(badPointer);
+
extension = (PDRIVER_DEVICE_EXTENSION)DeviceObject -> DeviceExtension;
ProcessorMask = (KAFFINITY)1;