File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
lib/semmle/javascript/dataflow/internal
test/library-tests/TripleDot Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -255,7 +255,10 @@ module Public {
255255 Content asSingleton ( ) { this = MkSingletonContent ( result ) }
256256
257257 /** Gets the property name to be accessed. */
258- PropertyName asPropertyName ( ) { result = this .asSingleton ( ) .asPropertyName ( ) }
258+ PropertyName asPropertyName ( ) {
259+ // TODO: array indices should be mapped to a ContentSet that also reads from UnknownArrayElement
260+ result = this .asSingleton ( ) .asPropertyName ( )
261+ }
259262
260263 /** Gets the array index to be accessed. */
261264 int asArrayIndex ( ) { result = this .asSingleton ( ) .asArrayIndex ( ) }
Original file line number Diff line number Diff line change @@ -163,3 +163,12 @@ function t15() {
163163 args . push ( source ( 't15.1' ) ) ;
164164 target ( 'safe' , ...args ) ;
165165}
166+
167+ function t16 ( ) {
168+ let array = new Array ( Math . floor ( Math . random ( ) * 10 ) )
169+ array . push ( source ( "t16.1" ) ) ;
170+ sink ( array [ 0 ] ) ; // $ MISSING: hasValueFlow=t16.1 SPURIOUS: hasTaintFlow=t16.1
171+ sink ( array [ 1 ] ) ; // $ MISSING: hasValueFlow=t16.1 SPURIOUS: hasTaintFlow=t16.1
172+ sink ( array [ 2 ] ) ; // $ MISSING: hasValueFlow=t16.1 SPURIOUS: hasTaintFlow=t16.1
173+ sink ( array ) ; // $ hasTaintFlow=t16.1
174+ }
You can’t perform that action at this time.
0 commit comments