@@ -436,31 +436,31 @@ fn test_fs() -> Result<(), Box<dyn std::error::Error>> {
436
436
437
437
async fn test_tokio_fs ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
438
438
{
439
- let buffer: Vec < u8 > = tokio:: fs:: read ( "file.bin" ) . await ?; // $ MISSING: Alert[rust/summary/taint-sources]
440
- sink ( buffer) ; // $ MISSING: hasTaintFlow="file.bin"
439
+ let buffer: Vec < u8 > = tokio:: fs:: read ( "file.bin" ) . await ?; // $ Alert[rust/summary/taint-sources]
440
+ sink ( buffer) ; // $ hasTaintFlow="file.bin"
441
441
}
442
442
443
443
{
444
- let buffer: Vec < u8 > = tokio:: fs:: read ( "file.bin" ) . await ?; // $ MISSING: Alert[rust/summary/taint-sources]
445
- sink ( buffer) ; // $ MISSING: hasTaintFlow="file.bin"
444
+ let buffer: Vec < u8 > = tokio:: fs:: read ( "file.bin" ) . await ?; // $ Alert[rust/summary/taint-sources]
445
+ sink ( buffer) ; // $ hasTaintFlow="file.bin"
446
446
}
447
447
448
448
{
449
- let buffer = tokio:: fs:: read_to_string ( "file.txt" ) . await ?; // $ MISSING: Alert[rust/summary/taint-sources]
450
- sink ( buffer) ; // $ MISSING: hasTaintFlow="file.txt"
449
+ let buffer = tokio:: fs:: read_to_string ( "file.txt" ) . await ?; // $ Alert[rust/summary/taint-sources]
450
+ sink ( buffer) ; // $ hasTaintFlow="file.txt"
451
451
}
452
452
453
453
let mut read_dir = tokio:: fs:: read_dir ( "directory" ) . await ?;
454
454
for entry in read_dir. next_entry ( ) . await ? {
455
- let path = entry. path ( ) ; // $ MISSING: Alert[rust/summary/taint-sources]
456
- let file_name = entry. file_name ( ) ; // $ MISSING: Alert[rust/summary/taint-sources]
457
- sink ( path) ; // $ MISSING: hasTaintFlow
458
- sink ( file_name) ; // $ MISSING: hasTaintFlow
455
+ let path = entry. path ( ) ; // $ Alert[rust/summary/taint-sources]
456
+ let file_name = entry. file_name ( ) ; // $ Alert[rust/summary/taint-sources]
457
+ sink ( path) ; // $ hasTaintFlow
458
+ sink ( file_name) ; // $ hasTaintFlow
459
459
}
460
460
461
461
{
462
- let target = tokio:: fs:: read_link ( "symlink.txt" ) . await ?; // $ MISSING: Alert[rust/summary/taint-sources]
463
- sink ( target) ; // $ MISSING: hasTaintFlow="symlink.txt"
462
+ let target = tokio:: fs:: read_link ( "symlink.txt" ) . await ?; // $ Alert[rust/summary/taint-sources]
463
+ sink ( target) ; // $ hasTaintFlow="symlink.txt"
464
464
}
465
465
466
466
Ok ( ( ) )
@@ -524,66 +524,66 @@ fn test_io_file() -> std::io::Result<()> {
524
524
async fn test_tokio_file ( ) -> std:: io:: Result < ( ) > {
525
525
// --- file ---
526
526
527
- let mut file = tokio:: fs:: File :: open ( "file.txt" ) . await ?; // $ MISSING: Alert[rust/summary/taint-sources]
527
+ let mut file = tokio:: fs:: File :: open ( "file.txt" ) . await ?; // $ Alert[rust/summary/taint-sources]
528
528
529
529
{
530
530
let mut buffer = [ 0u8 ; 100 ] ;
531
531
let _bytes = file. read ( & mut buffer) . await ?;
532
- sink ( & buffer) ; // $ MISSING: hasTaintFlow="file.txt"
532
+ sink ( & buffer) ; // $ hasTaintFlow="file.txt"
533
533
}
534
534
535
535
{
536
536
let mut buffer = Vec :: < u8 > :: new ( ) ;
537
537
let _bytes = file. read_to_end ( & mut buffer) . await ?;
538
- sink ( & buffer) ; // $ MISSING: hasTaintFlow="file.txt"
538
+ sink ( & buffer) ; // $ hasTaintFlow="file.txt"
539
539
}
540
540
541
541
{
542
542
let mut buffer = String :: new ( ) ;
543
543
let _bytes = file. read_to_string ( & mut buffer) . await ?;
544
- sink ( & buffer) ; // $ MISSING: hasTaintFlow="file.txt"
544
+ sink ( & buffer) ; // $ hasTaintFlow="file.txt"
545
545
}
546
546
547
547
{
548
548
let mut buffer = [ 0 ; 100 ] ;
549
549
file. read_exact ( & mut buffer) . await ?;
550
- sink ( & buffer) ; // $ MISSING: hasTaintFlow="file.txt"
550
+ sink ( & buffer) ; // $ hasTaintFlow="file.txt"
551
551
}
552
552
553
553
{
554
554
let v1 = file. read_u8 ( ) . await ?;
555
555
let v2 = file. read_i16 ( ) . await ?;
556
556
let v3 = file. read_f32 ( ) . await ?;
557
557
let v4 = file. read_i64_le ( ) . await ?;
558
- sink ( v1) ; // $ MISSING: hasTaintFlow
559
- sink ( v2) ; // $ MISSING: hasTaintFlow
560
- sink ( v3) ; // $ MISSING: hasTaintFlow
561
- sink ( v4) ; // $ MISSING: hasTaintFlow
558
+ sink ( v1) ; // $ hasTaintFlow="file.txt"
559
+ sink ( v2) ; // $ hasTaintFlow="file.txt"
560
+ sink ( v3) ; // $ hasTaintFlow="file.txt"
561
+ sink ( v4) ; // $ hasTaintFlow="file.txt"
562
562
}
563
563
564
564
{
565
565
let mut buffer = bytes:: BytesMut :: new ( ) ;
566
566
file. read_buf ( & mut buffer) . await ?;
567
- sink ( & buffer) ; // $ MISSING: hasTaintFlow
567
+ sink ( & buffer) ; // $ hasTaintFlow="file.txt"
568
568
}
569
569
570
570
// --- misc operations ---
571
571
572
572
{
573
573
let mut buffer = String :: new ( ) ;
574
- let file1 = tokio:: fs:: File :: open ( "file.txt" ) . await ?; // $ MISSING: Alert[rust/summary/taint-sources]
575
- let file2 = tokio:: fs:: File :: open ( "another_file.txt" ) . await ?; // $ MISSING: [rust/summary/taint-sources]
574
+ let file1 = tokio:: fs:: File :: open ( "file.txt" ) . await ?; // $ Alert[rust/summary/taint-sources]
575
+ let file2 = tokio:: fs:: File :: open ( "another_file.txt" ) . await ?; // $ Alert [rust/summary/taint-sources]
576
576
let mut reader = file1. chain ( file2) ;
577
577
reader. read_to_string ( & mut buffer) . await ?;
578
- sink ( & buffer) ; // $ MISSING: hasTaintFlow="file.txt" hasTaintFlow="another_file.txt"
578
+ sink ( & buffer) ; // $ hasTaintFlow="file.txt" hasTaintFlow="another_file.txt"
579
579
}
580
580
581
581
{
582
582
let mut buffer = String :: new ( ) ;
583
- let file1 = tokio:: fs:: File :: open ( "file.txt" ) . await ?; // $ MISSING: Alert[rust/summary/taint-sources]
583
+ let file1 = tokio:: fs:: File :: open ( "file.txt" ) . await ?; // $ Alert[rust/summary/taint-sources]
584
584
let mut reader = file1. take ( 100 ) ;
585
585
reader. read_to_string ( & mut buffer) . await ?;
586
- sink ( & buffer) ; // $ MISSING: hasTaintFlow="file.txt"
586
+ sink ( & buffer) ; // $ hasTaintFlow="file.txt"
587
587
}
588
588
589
589
Ok ( ( ) )
0 commit comments