File tree Expand file tree Collapse file tree
cpp/ql/src/Security/CWE/CWE-732 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ abstract class FileCreationWithOptionalModeExpr extends FileCreationExpr {
134134
135135class OpenCreationExpr extends FileCreationWithOptionalModeExpr {
136136 OpenCreationExpr ( ) {
137- this .getTarget ( ) .getName ( ) = [ "open" , "_open" , "_wopen" ] and
137+ this .getTarget ( ) .hasGlobalOrStdName ( [ "open" , "_open" , "_wopen" ] ) and
138138 exists ( int flag | flag = this .getArgument ( 1 ) .getValue ( ) .toInt ( ) |
139139 setsFlag ( flag , o_creat ( ) ) or setsFlag ( flag , o_tmpfile ( ) )
140140 )
@@ -163,7 +163,7 @@ class CreatCreationExpr extends FileCreationExpr {
163163
164164class OpenatCreationExpr extends FileCreationWithOptionalModeExpr {
165165 OpenatCreationExpr ( ) {
166- this .getTarget ( ) .getName ( ) = "openat" and
166+ this .getTarget ( ) .hasGlobalOrStdName ( "openat" ) and
167167 exists ( int flag | flag = this .getArgument ( 2 ) .getValue ( ) .toInt ( ) |
168168 setsFlag ( flag , o_creat ( ) ) or setsFlag ( flag , o_tmpfile ( ) )
169169 )
You can’t perform that action at this time.
0 commit comments