* lib/regexec.c (build_trtable): Return failure indication upon
calloc failure. Otherwise, re_search_internal could infloop on OOM.
In glibc, this was fixed for version 2.13:
http://sourceware.org/bugzilla/show_bug.cgi?id=12348
+2010-12-28 Jim Meyering <meyering@redhat.com>
+
+ regex: don't infloop on persistent failing calloc
+ * lib/regexec.c (build_trtable): Return failure indication upon
+ calloc failure. Otherwise, re_search_internal could infloop on OOM.
+ In glibc, this was fixed for version 2.13:
+ http://sourceware.org/bugzilla/show_bug.cgi?id=12348
+
2010-12-28 Bruno Haible <bruno@clisp.org>
Paul Eggert <eggert@cs.ucla.edu>
{
state->trtable = (re_dfastate_t **)
calloc (sizeof (re_dfastate_t *), SBC_MAX);
+ if (BE (state->trtable == NULL, 0))
+ return false;
return true;
}
return false;