On Mon, Jun 13, 2011 at 05:37:25PM +0100, Philip Hazel wrote: > If somebody is worried about crashes on unknown data, another approach
> is to set a trap to catch the signal before calling pcre_exec().
> Trapping SIGSEGV requires alterative stack. And once you are on alternative
stack your application is hosed anyway. One could wrap the pcre_exec() by
fork() and use alternative stack to die verbosely...
Maybe, if pcre_exec() stored stack pointer at the begining and then compare
distance to current stack frame on each recursion, one could get quite
accurate size of occupied stack space. Then it could be possible to implement
similar check for memory as in heap implementation.
Nevermind, thank you for your comments, pcre seems safe for exchanging
implementation after compilation. I will give a try and will wait what Fedora
users will report.