[CVE-2009-5155] Diagnose ERE '()|\1' 99/286499/1 accepted/tizen_6.0_base accepted/tizen_6.0_base_tool tizen_6.0_base accepted/tizen/6.0/base/20230713.143131 accepted/tizen/6.0/base/tool/20230116.011832 submit/tizen_6.0_base/20230112.235257
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 19 Sep 2015 20:53:34 +0000 (13:53 -0700)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 9 Jan 2023 05:07:29 +0000 (14:07 +0900)
commitdd69f20c88a64b7aa69a1cbf2e4062db6951ebb8
tree0dca620742036bef1d4814f78efd24653d98b4bd
parent1b31b6c4cf8c35c259c5eeb747f279b5046f90e4
[CVE-2009-5155] Diagnose ERE '()|\1'

Problem reported by Hanno Böck in: http://bugs.gnu.org/21513
* lib/regcomp.c (parse_reg_exp): While parsing alternatives, keep
track of the set of previously-completed subexpressions available
before the first alternative, and restore this set just before
parsing each subsequent alternative.  This lets us diagnose the
invalid back-reference in the ERE '()|\1'.

Change-Id: Ibaf26f055fc053fc76cfa7e4c14bf244a3b58b53
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
lib/regcomp.c