Skip to content

Fix formatting shared query ConstLikeReturnValue #129

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
problems
| test.c:8:8:8:12 | c_str | The object returned by the function getenv should not be modified. | test.c:15:16:15:21 | call to getenv | call to getenv | test.c:8:8:8:12 | c_str | c_str |
| test.c:64:5:64:9 | conv4 | The object returned by the function localeconv should not be modified. | test.c:61:11:61:20 | call to localeconv | call to localeconv | test.c:64:5:64:9 | conv4 | conv4 |
| test.c:73:5:73:8 | conv | The object returned by the function localeconv should not be modified. | test.c:69:25:69:34 | call to localeconv | call to localeconv | test.c:73:5:73:8 | conv | conv |
| test.c:8:8:8:12 | c_str | test.c:15:16:15:21 | call to getenv | test.c:8:8:8:12 | c_str | The object returned by the function getenv should not be modified. |
| test.c:64:5:64:9 | conv4 | test.c:61:11:61:20 | call to localeconv | test.c:64:5:64:9 | conv4 | The object returned by the function localeconv should not be modified. |
| test.c:73:5:73:8 | conv | test.c:69:25:69:34 | call to localeconv | test.c:73:5:73:8 | conv | The object returned by the function localeconv should not be modified. |
edges
| test.c:5:18:5:22 | c_str | test.c:8:8:8:12 | c_str |
| test.c:15:16:15:21 | call to getenv | test.c:21:9:21:12 | env1 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,13 @@ class DFConf extends DataFlow::Configuration {
}

query predicate problems(
Element e, string message, DataFlow::PathNode source, string sourcetext, DataFlow::PathNode sink,
string sinktext
Element e, DataFlow::PathNode source, DataFlow::PathNode sink, string message
) {
not isExcluded(e, getQuery()) and
// the modified object comes from a call to one of the ENV functions
any(DFConf d).hasFlowPath(source, sink) and
e = sink.getNode().asExpr() and
message =
"The object returned by the function " +
source.getNode().asExpr().(FunctionCall).getTarget().getName() + " should not be modified." and
sourcetext = source.toString() and
sinktext = sink.toString()
source.getNode().asExpr().(FunctionCall).getTarget().getName() + " should not be modified."
}