Actions
Bug #13352
closedRegExp infinite looping
Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
2.3.3p222 (2016-11-21 revision 56859) [x64-mingw32], ruby 2.2.4p230 (2015-12-16 revision 53155) [i386-mingw32]
Description
ruby entered an infinite loop with the following three steps.
r = /(?=\W)\W?(?:(?:(?:\/\*<)?[\'\"]?([\w_\$]+)[\'\"]?(?:>\*\/\s+this)?|(this))\.(\$scope|json)|([\'\"](?:\$scope|json)[\'\"]))((\.)(inputObjects)|(\.)(spreadSheets)(?:\.[\'\"]?([^\.\'\"\|\s,]+)[\'\"]?|\[[\'\"]?((?:[^\'\"\]\[]*|\[[^\]]*\])*)[\'\"]?\])(\.)(model))\s*(?:\.[\'\"]?([^\.\'\"\|\s,]+)[\'\"]?|\[[\'\"]?((?:[^\'\"\]\[]*|\[[^\]]*\])*)[\'\"]?\])/
txt = ".model |,| 'anController'.$scope.inputObjects['fieldName .../* !! comment ...*/"
txt.scan r
Node.js also falls into an infinite loop.
var r = /(?=\W)\W?(?:(?:(?:\/\*<)?[\'\"]?([\w_\$]+)[\'\"]?(?:>\*\/\s+this)?|(this))\.(\$scope|json)|([\'\"](?:\$scope|json)[\'\"]))((\.)(inputObjects)|(\.)(spreadSheets)(?:\.[\'\"]?([^\.\'\"\|\s,]+)[\'\"]?|\[[\'\"]?((?:[^\'\"\]\[]*|\[[^\]]*\])*)[\'\"]?\])(\.)(model))\s*(?:\.[\'\"]?([^\.\'\"\|\s,]+)[\'\"]?|\[[\'\"]?((?:[^\'\"\]\[]*|\[[^\]]*\])*)[\'\"]?\])/
var txt = ".model |,| 'anController'.$scope.inputObjects['fieldName .../* !! comment ...*/"
var s =r.exec (txt)
console.log(s)
Actions
Like0
Like0Like0Like0Like0Like0