CssSelectorNodeFilter with comma causes stack overflow
Brought to you by:
derrickoswald
When you instantiate a CssSelectorNodeFilter with a comma in it, it causes a stack overflow.
This is because the call to nextToken() is done after the recursive call and therefore, the same comma is seen again.
The patch is simple, reverse the following two lines in CssSelectorNodeFilter.java (158 & 159):
158 ret = new OrFilter (ret, parse ());
159 nextToken ();
to:
158 nextToken ();
159 ret = new OrFilter (ret, parse ());
I've attached a patch, in case that's easier.
patch for CssSelectorNodeFilter.java