[CVE-2009-5155] Diagnose ERE '()|\1' 50/254250/1 accepted/tizen_6.5_base accepted/tizen_6.5_base_tool backup/m4-1.4.17-20211230 tizen_6.5_base accepted/tizen/6.5/base/20230714.002603 accepted/tizen/6.5/base/tool/20211027.120238 accepted/tizen/base/tool/20210301.230508 submit/tizen_6.5_base/20211026.180901 submit/tizen_6.5_base/20211027.183101 submit/tizen_6.5_base/20211027.200801 submit/tizen_base/20210225.050823 tizen_6.5.m2_release
authorJinWang An <jinwang.an@samsung.com>
Thu, 25 Feb 2021 04:25:50 +0000 (13:25 +0900)
committerJinWang An <jinwang.an@samsung.com>
Thu, 25 Feb 2021 04:25:50 +0000 (13:25 +0900)
commitc35b28d627d4804963e084bdd051993064cb25d7
tree12d9ecacd919bb93796b4aaffb4fd99a6b98ca26
parent875a98baebfca49e1ecdad28562ccaa2e57e9b3a
[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: I6de4f8c79837656f670b5c34a0869619af198abe
Signed-off-by: JinWang An <jinwang.an@samsung.com>
lib/regcomp.c