changeset 12570:3ed9d84fee81

regcomp: recognize ill-formed { } expressions * lib/regcomp.c (parse_dup_op): From glibc: http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a87cd2894cb
author Ulrich Drepper <drepper@redhat.com>
date Mon, 04 Jan 2010 10:51:34 +0100
parents 51ea446bf1f8
children 64d47f001127
files ChangeLog lib/regcomp.c
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2010-01-04  Jim Meyering  <meyering@redhat.com>
 
+	regcomp: recognize ill-formed { } expressions
+	* lib/regcomp.c (parse_dup_op): From glibc:
+	http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a87cd2894cb
+
 	regcomp: fix typo in comment
 	* lib/regcomp.c (duplicate_node_closure): Sync from glibc.
 	s/satisfy/satisfies/.
--- a/lib/regcomp.c
+++ b/lib/regcomp.c
@@ -2519,7 +2519,8 @@
 	  return elem;
 	}
 
-      if (BE (end != REG_MISSING && start > end, 0))
+      if (BE ((end != REG_MISSING && start > end)
+	      || token->type != OP_CLOSE_DUP_NUM, 0))
 	{
 	  /* First number greater than second.  */
 	  *err = REG_BADBR;