Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/external/gpl2/grep/dist/lib Pull up following revision(s)...



details:   https://anonhg.NetBSD.org/src/rev/e63853fa722d
branches:  netbsd-9
changeset: 952839:e63853fa722d
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Feb 19 17:41:19 2021 +0000

description:
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:

 external/gpl2/grep/dist/lib/regex.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 3470e014d5b5 -r e63853fa722d external/gpl2/grep/dist/lib/regex.c
--- a/external/gpl2/grep/dist/lib/regex.c       Wed Feb 17 09:52:36 2021 +0000
+++ b/external/gpl2/grep/dist/lib/regex.c       Fri Feb 19 17:41:19 2021 +0000
@@ -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 @@
     /* 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 @@
     /* 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)                                             \



Home | Main Index | Thread Index | Old Index