-
Notifications
You must be signed in to change notification settings - Fork 2k
C++: Add a few more models #20769
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
C++: Add a few more models #20769
Changes from 4 commits
0607100
1d5d272
2b6a75f
f0da0d9
f163d01
56b9566
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| extensions: | ||
| - addsTo: | ||
| pack: codeql/cpp-all | ||
| extensible: summaryModel | ||
| data: # namespace, type, subtypes, name, signature, ext, input, output, kind, provenance | ||
| - ["", "", False, "tolower", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] | ||
| - ["std", "", False, "tolower", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] | ||
| - ["", "", False, "toupper", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] | ||
| - ["std", "", False, "toupper", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| extensions: | ||
| - addsTo: | ||
| pack: codeql/cpp-all | ||
| extensible: summaryModel | ||
| data: # namespace, type, subtypes, name, signature, ext, input, output, kind, provenance | ||
| - ["", "", False, "iconv", "", "", "Argument[**1]", "Argument[**3]", "value", "manual"] | ||
|
|
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -36,7 +36,11 @@ class StrcpyFunction extends ArrayFunction, DataFlowFunction, TaintFunction, Sid | |||||
| "_mbsnbcpy", // _mbsnbcpy(dest, src, max_amount) | ||||||
| "stpcpy", // stpcpy(dest, src) | ||||||
| "stpncpy", // stpncpy(dest, src, max_amount) | ||||||
| "strlcpy" // strlcpy(dst, src, dst_size) | ||||||
| "strlcpy", // strlcpy(dst, src, dst_size) | ||||||
| "__builtin___strcpy_chk", // __builtin___strcpy_chk (dest, src, magic); | ||||||
| "__builtin___stpcpy_chk", // __builtin___stpcpy_chk (dest, src, magic); | ||||||
| "__builtin___stpncpy_chk", // __builtin___stpncpy_chk(dest, src, max_amount, magic) | ||||||
|
||||||
| "__builtin___stpncpy_chk", // __builtin___stpncpy_chk(dest, src, max_amount, magic) | |
| "__builtin___stpncpy_chk", // __builtin___stpncpy_chk(dest, src, max_amount, magic); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we just want to get rid of the semi-colons, similarly for strcat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in f163d01
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that __builtin___stpncpy_chk and __builtin___strncpy_chk are already covered by %ncpy%.
The __builtin___strcpy_chk and __builtin___stpcpy_chk functions don't seem to belong here, as they don't have a size argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh oh, you're right. Looks like this last commit went slightly too fast 😅 I'll fix this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 56b9566
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what
__builtin___strcat_chk(without then) is doing here. This seems to be from taint flow from the numeric argument ofstrncat.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦 You're right!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 56b9566