Skip to content

Commit 1a08fcd

Browse files
committed
Ruby: Inline expectation should have space after $
This was a regex-find-replace from `# \$(?! )` (using a negative lookahead) to `# $ `.
1 parent 63b5b1f commit 1a08fcd

File tree

12 files changed

+193
-193
lines changed

12 files changed

+193
-193
lines changed

ruby/ql/lib/codeql/ruby/security/InsecureDownloadCustomizations.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ module InsecureDownload {
163163
//
164164
// ```rb
165165
// f = File.open("foo.exe")
166-
// f.write(Excon.get(...).body) # $BAD=
166+
// f.write(Excon.get(...).body) # $ BAD=
167167
// ```
168168
//
169169
// `f` is the `FileSystemAccess` and the call `f.write` is the `IO::FileWriter`.

ruby/ql/src/experimental/cwe-176/examples/unicode_normalization.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class UnicodeNormalizationHtMLSafeController < ActionController::Base
44
def unicodeNormalize
55
unicode_input = params[:unicode_input]
66
unicode_html_safe = ERB::Util.html_escape(unicode_input)
7-
normalized_nfkc = unicode_html_safe.unicode_normalize(:nfkc) # $result=BAD
8-
normalized_nfc = unicode_html_safe.unicode_normalize(:nfc) # $result=BAD
7+
normalized_nfkc = unicode_html_safe.unicode_normalize(:nfkc) # $ result=BAD
8+
normalized_nfc = unicode_html_safe.unicode_normalize(:nfc) # $ result=BAD
99
end
1010
end

ruby/ql/test/library-tests/dataflow/flow-summaries/semantics.rb

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ def m7(x)
4545
def m8
4646
sink(s8 { source "a" }) # $ hasValueFlow=a
4747
sink(s8 do
48-
source "a"
49-
end) # $hasValueFlow=a
48+
source "a"
49+
end) # $ hasValueFlow=a
5050
end
5151

5252
def m9
@@ -259,7 +259,7 @@ def m31(h, i)
259259
h[:bar] = source("b")
260260
h[1] = source("c")
261261
h[i] = source("d")
262-
262+
263263
sink s31(h) # $ hasValueFlow=a hasValueFlow=d
264264
end
265265

@@ -269,7 +269,7 @@ def m32(h, i)
269269
h[:bar] = source("c")
270270
h[1] = source("d")
271271
h[i] = source("e")
272-
272+
273273
sink s32(h) # $ hasValueFlow=b $ hasValueFlow=e $ SPURIOUS: hasValueFlow=a
274274
end
275275

@@ -282,7 +282,7 @@ def m33(h, i)
282282
h[nil] = source("f")
283283
h[true] = source("g")
284284
h[false] = source("h")
285-
285+
286286
sink s33(h) # $ hasValueFlow=e hasValueFlow=f hasValueFlow=g hasValueFlow=h
287287
end
288288

@@ -312,7 +312,7 @@ def m37(h, i)
312312
def m38(h, i)
313313
h["foo"] = source("a")
314314
h[i] = source("b")
315-
315+
316316
sink s38(h) # $ hasValueFlow=a
317317
end
318318

@@ -364,7 +364,7 @@ def m44(i, h)
364364
h[i] = source("c")
365365

366366
s44(h)
367-
367+
368368
sink h[0]
369369
sink h[1] # $ hasValueFlow=b
370370
sink h[i] # $ hasValueFlow=b
@@ -380,7 +380,7 @@ def m45(i, h)
380380
sink h[i] # $ hasValueFlow=a hasValueFlow=b hasValueFlow=c
381381

382382
s45(h)
383-
383+
384384
sink h[0] # $ hasValueFlow=c
385385
sink h[1] # $ hasValueFlow=b hasValueFlow=c
386386
sink h[i] # $ hasValueFlow=b hasValueFlow=c
@@ -396,7 +396,7 @@ def m46(i, h)
396396
sink h[i] # $ hasValueFlow=a hasValueFlow=b hasValueFlow=c
397397

398398
x = s46(h)
399-
399+
400400
sink x[0]
401401
sink x[1] # $ hasValueFlow=b
402402
sink x[i] # $ hasValueFlow=b
@@ -406,12 +406,12 @@ def m47(i, h)
406406
h[:foo] = source("a")
407407
h[:bar] = source("b")
408408
h[i] = source("c")
409-
409+
410410
sink h[:foo] # $ hasValueFlow=a hasValueFlow=c
411411
sink h[:bar] # $ hasValueFlow=b hasValueFlow=c
412-
412+
413413
x = s47(h)
414-
414+
415415
sink x[:foo]
416416
sink x[:bar] # $ hasValueFlow=b
417417
end
@@ -420,12 +420,12 @@ def m48(i, h)
420420
h[:foo] = source("a")
421421
h[:bar] = source("b")
422422
h[i] = source("c")
423-
423+
424424
sink h[:foo] # $ hasValueFlow=a hasValueFlow=c
425425
sink h[:bar] # $ hasValueFlow=b hasValueFlow=c
426-
426+
427427
x = s48(h)
428-
428+
429429
sink x[:foo]
430430
sink x[:bar] # $ hasValueFlow=b
431431
end
@@ -434,12 +434,12 @@ def m49(i, h)
434434
h[:foo] = source("a")
435435
h[:bar] = source("b")
436436
h[i] = source("c")
437-
437+
438438
sink h[:foo] # $ hasValueFlow=a hasValueFlow=c
439439
sink h[:bar] # $ hasValueFlow=b hasValueFlow=c
440-
440+
441441
x = s49(h)
442-
442+
443443
sink x[:foo] # $ hasValueFlow=c
444444
sink x[:bar] # $ hasValueFlow=b hasValueFlow=c
445445
end
@@ -448,12 +448,12 @@ def m50(i, h)
448448
h[:foo] = source("a")
449449
h[:bar] = source("b")
450450
h[i] = source("c")
451-
451+
452452
sink h[:foo] # $ hasValueFlow=a hasValueFlow=c
453453
sink h[:bar] # $ hasValueFlow=b hasValueFlow=c
454-
454+
455455
s50(h)
456-
456+
457457
sink h[:foo]
458458
sink h[:bar] # $ hasValueFlow=b
459459
end
@@ -462,12 +462,12 @@ def m51(i, h)
462462
h[:foo] = source("a")
463463
h[:bar] = source("b")
464464
h[i] = source("c")
465-
465+
466466
sink h[:foo] # $ hasValueFlow=a hasValueFlow=c
467467
sink h[:bar] # $ hasValueFlow=b hasValueFlow=c
468-
468+
469469
s51(h)
470-
470+
471471
sink h[:foo] # $ hasValueFlow=c
472472
sink h[:bar] # $ hasValueFlow=b hasValueFlow=c
473473
end
@@ -476,12 +476,12 @@ def m52(i, h)
476476
h[:foo] = source("a")
477477
h[:bar] = source("b")
478478
h[i] = source("c")
479-
479+
480480
sink h[:foo] # $ hasValueFlow=a hasValueFlow=c
481481
sink h[:bar] # $ hasValueFlow=b hasValueFlow=c
482-
482+
483483
h.s52
484-
484+
485485
sink h[:foo]
486486
sink h[:bar] # $ hasValueFlow=b
487487
end
@@ -490,12 +490,12 @@ def m53(i, h)
490490
h[:foo] = source("a")
491491
h[:bar] = source("b")
492492
h[i] = source("c")
493-
493+
494494
sink h[:foo] # $ hasValueFlow=a hasValueFlow=c
495495
sink h[:bar] # $ hasValueFlow=b hasValueFlow=c
496-
496+
497497
x = h.s53()
498-
498+
499499
sink x[:foo]
500500
sink x[:bar] # $ hasValueFlow=b
501501

0 commit comments

Comments
 (0)