summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authormartin <martin@NetBSD.org>2021-02-19 17:41:19 +0000
committermartin <martin@NetBSD.org>2021-02-19 17:41:19 +0000
commit3ad72b76d7332c2d6d22b733f87b8bb2c6aed948 (patch)
treeef95b48f438577136494b329f8c959637237dcfb /external
parentdc0f40f14e2ff0799e935938eea4a3e7520635cd (diff)
Pull up following revision(s) (requested by mlelstv in ticket #1208):
external/gpl2/grep/dist/lib/regex.c: revision 1.3 Moving pointers could fail if realloc() allocates a new memory region where the difference between old and new address exceeds an int. Use ptrdiff_t for calculations instead.
Diffstat (limited to 'external')
-rw-r--r--external/gpl2/grep/dist/lib/regex.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/external/gpl2/grep/dist/lib/regex.c b/external/gpl2/grep/dist/lib/regex.c
index ef47b99fc2c..6ef8fc3c676 100644
--- a/external/gpl2/grep/dist/lib/regex.c
+++ b/external/gpl2/grep/dist/lib/regex.c
@@ -1,4 +1,4 @@
-/* $NetBSD: regex.c,v 1.2 2016/01/10 22:16:40 christos Exp $ */
+/* $NetBSD: regex.c,v 1.2.18.1 2021/02/19 17:41:19 martin Exp $ */
/* Extended regular expression matching and search library,
version 0.12.
@@ -2047,7 +2047,7 @@ static reg_errcode_t compile_range _RE_ARGS ((unsigned int range_start,
/* If the buffer moved, move all the pointers into it. */ \
if (old_buffer != COMPILED_BUFFER_VAR) \
{ \
- int incr = COMPILED_BUFFER_VAR - old_buffer; \
+ ptrdiff_t incr = COMPILED_BUFFER_VAR - old_buffer; \
MOVE_BUFFER_POINTER (b); \
MOVE_BUFFER_POINTER (begalt); \
if (fixup_alt_jump) \
@@ -2075,7 +2075,7 @@ static reg_errcode_t compile_range _RE_ARGS ((unsigned int range_start,
/* If the buffer moved, move all the pointers into it. */ \
if (old_buffer != COMPILED_BUFFER_VAR) \
{ \
- int incr = COMPILED_BUFFER_VAR - old_buffer; \
+ ptrdiff_t incr = COMPILED_BUFFER_VAR - old_buffer; \
MOVE_BUFFER_POINTER (b); \
MOVE_BUFFER_POINTER (begalt); \
if (fixup_alt_jump) \