File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed
lib/codeql/ruby/frameworks/core/internal
test/library-tests/frameworks/files Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ class IOOrFileWriteMethodCall extends IOOrFileMethodCall {
137137 receiverKind = "class" and
138138 api = [ "IO" , "File" ] and
139139 this = API:: getTopLevelMember ( api ) .getAMethodCall ( methodName ) and
140- methodName = [ "binwrite" , "write" ] and
140+ methodName = [ "binwrite" , "write" , "atomic_write" ] and
141141 dataNode = this .getArgument ( 1 )
142142 or
143143 // e.g. `{IO,File}.new("foo.txt", "a+).puts("hello")`
Original file line number Diff line number Diff line change @@ -76,6 +76,8 @@ fileSystemAccesses
7676| Files.rb:41:1:41:26 | call to open |
7777| Files.rb:41:1:41:43 | call to write |
7878| Files.rb:48:1:48:40 | call to printf |
79+ | Files.rb:49:1:49:30 | call to write |
80+ | Files.rb:50:1:50:37 | call to atomic_write |
7981fileNameSources
8082| Files.rb:10:6:10:18 | call to path |
8183| Files.rb:11:6:11:21 | call to to_path |
@@ -86,7 +88,11 @@ fileWriters
8688| Files.rb:40:1:40:22 | call to puts |
8789| Files.rb:41:1:41:43 | call to write |
8890| Files.rb:48:1:48:40 | call to printf |
91+ | Files.rb:49:1:49:30 | call to write |
92+ | Files.rb:50:1:50:37 | call to atomic_write |
8993fileSystemWriteAccesses
9094| Files.rb:40:1:40:22 | call to puts |
9195| Files.rb:41:1:41:43 | call to write |
9296| Files.rb:48:1:48:40 | call to printf |
97+ | Files.rb:49:1:49:30 | call to write |
98+ | Files.rb:50:1:50:37 | call to atomic_write |
Original file line number Diff line number Diff line change 4646int_1 = 123
4747# File/IO write
4848io_file . printf ( "%s: %d\n " , str_1 , int_1 )
49+ File . write ( "foo.txt" , "hello" )
50+ File . atomic_write ( "foo.txt" , "hello" )
You can’t perform that action at this time.
0 commit comments