Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit57a2583

Browse files
authored
Merge branch 'main' into lcartey/no-c90
2 parentsc472266 +4a355fc commit57a2583

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

‎c/common/test/rules/constlikereturnvalue/ConstLikeReturnValue.expected‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
problems
2-
| 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 |
3-
| 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 |
4-
| 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 |
2+
| 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. |
3+
| 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. |
4+
| 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. |
55
edges
66
| test.c:5:18:5:22 | c_str | test.c:8:8:8:12 | c_str |
77
| test.c:15:16:15:21 | call to getenv | test.c:21:9:21:12 | env1 |

‎cpp/common/src/codingstandards/cpp/rules/constlikereturnvalue/ConstLikeReturnValue.qll‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,13 @@ class DFConf extends DataFlow::Configuration {
5252
}
5353

5454
querypredicateproblems(
55-
Elemente,stringmessage, DataFlow::PathNodesource,stringsourcetext, DataFlow::PathNodesink,
56-
stringsinktext
55+
Elemente, DataFlow::PathNodesource, DataFlow::PathNodesink,stringmessage
5756
){
5857
notisExcluded(e,getQuery())and
5958
// the modified object comes from a call to one of the ENV functions
6059
any(DFConfd).hasFlowPath(source,sink)and
6160
e=sink.getNode().asExpr()and
6261
message=
6362
"The object returned by the function "+
64-
source.getNode().asExpr().(FunctionCall).getTarget().getName()+" should not be modified."and
65-
sourcetext=source.toString()and
66-
sinktext=sink.toString()
63+
source.getNode().asExpr().(FunctionCall).getTarget().getName()+" should not be modified."
6764
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp