summary refs log tree commit diff
path: root/posix
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-11-13 17:25:46 +0000
committerUlrich Drepper <drepper@redhat.com>2003-11-13 17:25:46 +0000
commitdeeb4aae693e746cec733826c2b90d9214a27dd9 (patch)
tree5e09066397827d21400ca7d5cb5ac6899ee4b261 /posix
parentb27eea96b9046ee6adf1d4906d774204447a2fa6 (diff)
downloadglibc-deeb4aae693e746cec733826c2b90d9214a27dd9.tar.gz
glibc-deeb4aae693e746cec733826c2b90d9214a27dd9.tar.xz
glibc-deeb4aae693e746cec733826c2b90d9214a27dd9.zip
(parse_dup_op): Fail with REG_BADBR is first number in {,} expression is larger.
Diffstat (limited to 'posix')
-rw-r--r--posix/regcomp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/posix/regcomp.c b/posix/regcomp.c
index 9a48aa3f3b..0dee2e62fc 100644
--- a/posix/regcomp.c
+++ b/posix/regcomp.c
@@ -2412,6 +2412,12 @@ parse_dup_op (dup_elem, regexp, dfa, token, syntax, err)
 		goto parse_dup_op_espace;
 	    }
 	}
+      else if (BE (start > end, 0))
+	{
+	  /* First  number greater than first.  */
+	  *err = REG_BADBR;
+	  return NULL;
+	}
       else if (end - start > 0)
 	{
 	  /* Then extract "<re>{0,m}" to "<re>?<re>?...<re>?".  */