1 diff --git a/lib/regexec.c b/lib/regexec.c
2 index 21a8166..7762437 100644
6 with this program; if not, write to the Free Software Foundation,
7 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
10 +#include "intprops.h"
11 static reg_errcode_t match_ctx_init (re_match_context_t *cache, int eflags,
12 Idx n) internal_function;
13 static void match_ctx_clean (re_match_context_t *mctx) internal_function;
14 @@ -378,8 +380,11 @@ re_search_2_stub (struct re_pattern_buffer *bufp,
15 Idx len = length1 + length2;
18 - if (BE (length1 < 0 || length2 < 0 || stop < 0 || len < length1, 0))
20 + verify (! TYPE_SIGNED (Idx));
21 + if (BE (len < length1, 0))
23 + /* if (BE (length1 < 0 || length2 < 0 || stop < 0, 0))
26 /* Concatenate the strings. */
28 @@ -431,11 +436,14 @@ re_search_stub (struct re_pattern_buffer *bufp,
29 Idx last_start = start + range;
31 /* Check for out-of-range. */
32 - if (BE (start < 0 || start > length, 0))
34 + verify (! TYPE_SIGNED (Idx));
35 + /* if (BE (start < 0, 0))
37 + if (BE (start > length, 0))
39 if (BE (length < last_start || (0 <= range && last_start < start), 0))
41 - else if (BE (last_start < 0 || (range < 0 && start <= last_start), 0))
42 + else if (BE (/* last_start < 0 || */ (range < 0 && start <= last_start), 0))
45 __libc_lock_lock (dfa->lock);