mirror of
https://github.com/github/codeql.git
synced 2026-04-30 03:05:15 +02:00
JS: Add test for class with locally-unused field
This commit is contained in:
@@ -0,0 +1 @@
|
||||
<sink-component [sink6]="field"></sink-component>
|
||||
@@ -0,0 +1,9 @@
|
||||
import { Input, Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'mid-component',
|
||||
templateUrl: './mid.component.html'
|
||||
})
|
||||
export class MidComponent {
|
||||
@Input() field: string;
|
||||
}
|
||||
@@ -11,6 +11,7 @@ export class SinkComponent {
|
||||
sink3: string;
|
||||
sink4: string;
|
||||
sink5: string;
|
||||
sink6: string;
|
||||
|
||||
constructor(private sanitizer: DomSanitizer) {}
|
||||
|
||||
@@ -20,5 +21,6 @@ export class SinkComponent {
|
||||
this.sanitizer.bypassSecurityTrustHtml(this.sink3);
|
||||
this.sanitizer.bypassSecurityTrustHtml(this.sink4);
|
||||
this.sanitizer.bypassSecurityTrustHtml(this.sink5);
|
||||
this.sanitizer.bypassSecurityTrustHtml(this.sink6);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,3 +13,5 @@
|
||||
<div *ngFor="let element of safeArray">
|
||||
<sink-component [sink2]="element"></sink-component>
|
||||
</div>
|
||||
|
||||
<mid-component [field]="taint"></mid-component>
|
||||
|
||||
@@ -22,7 +22,8 @@ pipeClassRef
|
||||
| TestPipe.ts:4:8:9:1 | class T ... ;\\n }\\n} | source.component.html:5:22:5:29 | testPipe |
|
||||
| TestPipe.ts:4:8:9:1 | class T ... ;\\n }\\n} | source.component.html:6:19:6:26 | testPipe |
|
||||
taintFlow
|
||||
| source.component.ts:13:22:13:29 | source() | sink.component.ts:18:48:18:57 | this.sink1 |
|
||||
| source.component.ts:13:22:13:29 | source() | sink.component.ts:21:48:21:57 | this.sink4 |
|
||||
| source.component.ts:13:22:13:29 | source() | sink.component.ts:22:48:22:57 | this.sink5 |
|
||||
| source.component.ts:14:33:14:40 | source() | sink.component.ts:18:48:18:57 | this.sink1 |
|
||||
| source.component.ts:13:22:13:29 | source() | sink.component.ts:19:48:19:57 | this.sink1 |
|
||||
| source.component.ts:13:22:13:29 | source() | sink.component.ts:22:48:22:57 | this.sink4 |
|
||||
| source.component.ts:13:22:13:29 | source() | sink.component.ts:23:48:23:57 | this.sink5 |
|
||||
| source.component.ts:13:22:13:29 | source() | sink.component.ts:24:48:24:57 | this.sink6 |
|
||||
| source.component.ts:14:33:14:40 | source() | sink.component.ts:19:48:19:57 | this.sink1 |
|
||||
|
||||
Reference in New Issue
Block a user