1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-01 10:06:57 +03:00

regex: fix storage-exhaustion error

[BZ #18040]
* posix/regexec.c (get_subexp):
Do not continue if storage is exhausted.
This commit is contained in:
Paul Eggert
2018-09-05 23:57:08 -07:00
parent 077caf61d8
commit ef202e530c
2 changed files with 9 additions and 0 deletions

View File

@ -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;