pcre compile workspace overflow

Michael Santos michael.santos@REDACTED
Fri Mar 19 02:02:24 CET 2010


A large pattern can overflow the buffer used to hold the compiled
regexp, as reported here:

http://www.erlang.org/cgi-bin/ezmlm-cgi/2/1289

So, running the following will crash the emulator on some platforms:

N = 819, re:compile([lists:duplicate(N, $(), lists:duplicate(N, $))]).

Here is a patch:

git fetch git://github.com/msantos/otp.git pcre-compile-workspace-overrun

The patch is from:

http://vcs.pcre.org/viewvc/code/trunk/pcre_compile.c?r1=504&r2=505&view=patch




More information about the erlang-patches mailing list