#192 tokenize() crashes if regex not known statically

v7.9
closed
Michael Kay
5
2012-10-08
2004-03-09
Michael Kay
No

If tokenize() is called with a regex in the second
argument whose value is not known statically, a compile-
time NullPointerException occurs.

Source fix:

in net.sf.saxon.functions.Tokenize,

at line 42 change

if (regexp.matcher("").matches()) {

to

if (regexp != null && regexp.matcher("").matches()) {

At line 84 change

if (regexp.matcher("").matches()) {

to

if (re.matcher("").matches()) {

Test case added (regex21)

Discussion