maint: adjust the URL that will appear in the generated announcement
[coreutils/ericb.git] / gl / lib / regexec.c.diff
blobd9b6d1cd5eafde1fe2d3940a9d214d5c152d3afe
1 diff --git a/lib/regexec.c b/lib/regexec.c
2 index 21a8166..7762437 100644
3 --- a/lib/regexec.c
4 +++ b/lib/regexec.c
5 @@ -18,6 +18,8 @@
6 with this program; if not, write to the Free Software Foundation,
7 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
9 +#include "verify.h"
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;
16 char *s = NULL;
18 - if (BE (length1 < 0 || length2 < 0 || stop < 0 || len < length1, 0))
19 - return -2;
20 + verify (! TYPE_SIGNED (Idx));
21 + if (BE (len < length1, 0))
22 + return -2;
23 + /* if (BE (length1 < 0 || length2 < 0 || stop < 0, 0))
24 + return -2; */
26 /* Concatenate the strings. */
27 if (length2 > 0)
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))
33 - return -1;
34 + verify (! TYPE_SIGNED (Idx));
35 + /* if (BE (start < 0, 0))
36 + return -1; */
37 + if (BE (start > length, 0))
38 + return -1;
39 if (BE (length < last_start || (0 <= range && last_start < start), 0))
40 last_start = length;
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))
43 last_start = 0;
45 __libc_lock_lock (dfa->lock);