File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -176,12 +176,15 @@ test('invalid version does not cause catatrophic backtracking', t => {
176176 // Note reproduces attack string generated by https://devina.io/redos-checker
177177 const start = Date . now ( ) ;
178178 const fixtures = [
179- '0.0.1-i' + '--i-' . repeat ( index ) + '\x00 ' ,
179+ '0.0.1-i' + '--i-' . repeat ( index ) + '\u0000 ' ,
180180 '0' + ' 0.1.0-i0' . repeat ( index ) + '.1.1+1' + '1' . repeat ( index ) + 'A' ,
181- '1.0.1--' + '-' . repeat ( index ) + '\x00' ,
182- 'g' + ' 0.0.1-i+' . repeat ( index ) + 'a' + 'v0' . repeat ( index ) + '\x00'
183- ]
184- fixtures . forEach ( ( fixture ) => semverRegex ( ) . test ( fixture ) ) ;
181+ '1.0.1--' + '-' . repeat ( index ) + '\u0000' ,
182+ 'g' + ' 0.0.1-i+' . repeat ( index ) + 'a' + 'v0' . repeat ( index ) + '\u0000' ,
183+ ] ;
184+ for ( const fixture of fixtures ) {
185+ semverRegex ( ) . test ( fixture ) ;
186+ }
187+
185188 const difference = Date . now ( ) - start ;
186189 t . true ( difference < 20 , `Execution time: ${ difference } ` ) ;
187190 }
You can’t perform that action at this time.
0 commit comments