From ef202e530c2384d6a47951ed1c6b63ed945e462f Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 5 Sep 2018 23:57:08 -0700 Subject: regex: fix storage-exhaustion error [BZ #18040] * posix/regexec.c (get_subexp): Do not continue if storage is exhausted. --- posix/regexec.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'posix') diff --git a/posix/regexec.c b/posix/regexec.c index a29e8ad1ff..ecb430d302 100644 --- a/posix/regexec.c +++ b/posix/regexec.c @@ -2786,6 +2786,8 @@ get_subexp (re_match_context_t *mctx, Idx bkref_node, Idx bkref_str_idx) buf = (const char *) re_string_get_buffer (&mctx->input); if (err == REG_NOMATCH) continue; + if (__glibc_unlikely (err != REG_NOERROR)) + return err; } } return REG_NOERROR; -- cgit 1.4.1