-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into amammad-js-CodeInjection_execa
- Loading branch information
Showing
271 changed files
with
6,712 additions
and
5,942 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
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
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
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
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
4 changes: 4 additions & 0 deletions
4
cpp/ql/src/change-notes/2024-05-22-use-of-unique-pointer-after-lifetime-ends-fp.md
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
category: minorAnalysis | ||
--- | ||
* The "Use of unique pointer after lifetime ends" query (`cpp/use-of-unique-pointer-after-lifetime-ends`) no longer reports an alert when the pointer is converted to a boolean |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
char * create (int arg) { | ||
if (arg > 42) { | ||
// this function may return NULL | ||
return NULL; | ||
} | ||
char * r = malloc(arg); | ||
snprintf(r, arg -1, "Hello"); | ||
return r; | ||
} | ||
|
||
void process(char *str) { | ||
// str is dereferenced | ||
if (str[0] == 'H') { | ||
printf("Hello H\n"); | ||
} | ||
} | ||
|
||
void test(int arg) { | ||
// first function returns a pointer that may be NULL | ||
char *str = create(arg); | ||
// str is not checked for nullness before being passed to process function | ||
process(str); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!DOCTYPE qhelp PUBLIC | ||
"-//Semmle//qhelp//EN" | ||
"qhelp.dtd"> | ||
<qhelp> | ||
|
||
<overview> | ||
<p>This rule finds a dereference of a function parameter, whose value comes from another function call that may return NULL, without checks in the meantime.</p> | ||
</overview> | ||
|
||
<recommendation> | ||
<p>A check should be added between the return of the function which may return NULL, and its use by the function dereferencing ths pointer.</p> | ||
</recommendation> | ||
|
||
<example> | ||
<sample src="DerefNullResult.cpp" /> | ||
</example> | ||
|
||
<references> | ||
<li> | ||
<a href="https://www.owasp.org/index.php/Null_Dereference"> | ||
Null Dereference | ||
</a> | ||
</li> | ||
</references> | ||
|
||
</qhelp> |
Oops, something went wrong.