google / re2j

linear time regular expression matching in Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pattern Leading to NullPointerException

schirrmacher opened this issue · comments

When I compile the pattern: "..|.#|..":

Pattern.compile("..|.#|..")

I get java.lang.NullPointerException exception.

== Java Exception: java.lang.NullPointerException: Cannot read the array length because "subMax.runes" is null
	at com.google.re2j.Parser.factor(Parser.java:552)
	at com.google.re2j.Parser.collapse(Parser.java:344)
	at com.google.re2j.Parser.factor(Parser.java:512)
	at com.google.re2j.Parser.collapse(Parser.java:344)
	at com.google.re2j.Parser.alternate(Parser.java:294)
	at com.google.re2j.Parser.parseInternal(Parser.java:975)
	at com.google.re2j.Parser.parse(Parser.java:788)
	at com.google.re2j.RE2.compileImpl(RE2.java:187)
	at com.google.re2j.Pattern.compile(Pattern.java:149)
	at com.google.re2j.Pattern.compile(Pattern.java:107)

I applied the Jazzer Fuzzer to your lib. Maybe an integration is worth it.

This was fixed in #149