grep-commit
[Top][All Lists]
Advanced

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

grep branch, master, updated. v3.7-21-gb3a85a1


From: Paul Eggert
Subject: grep branch, master, updated. v3.7-21-gb3a85a1
Date: Tue, 9 Nov 2021 13:12:26 -0500 (EST)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grep".

The branch, master has been updated
       via  b3a85a1a8a816f4f6f9c01399c16efe92a86ca06 (commit)
       via  c562691787709e5ebfec9f298f8d702efe8291b7 (commit)
      from  1ba972edec7867c1592083363dc9fadfebf77e2e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=b3a85a1a8a816f4f6f9c01399c16efe92a86ca06


commit b3a85a1a8a816f4f6f9c01399c16efe92a86ca06
Author: Paul Eggert <eggert@cs.ucla.edu>
Date:   Tue Nov 9 10:11:42 2021 -0800

    grep: work around PCRE bug
    
    Problem reported by Carlo Marcelo Arenas Belón (Bug#51710).
    * src/pcresearch.c (jit_exec): Don’t attempt to grow the JIT stack
    over INT_MAX - 8 * 1024.

diff --git a/src/pcresearch.c b/src/pcresearch.c
index 3bdaee9..09f92c8 100644
--- a/src/pcresearch.c
+++ b/src/pcresearch.c
@@ -72,8 +72,11 @@ jit_exec (struct pcre_comp *pc, char const *subject, int 
search_bytes,
                          search_offset, options, sub, NSUB);
 
 #if PCRE_STUDY_JIT_COMPILE
+      /* Going over this would trigger an int overflow bug within PCRE.  */
+      int jitstack_max = INT_MAX - 8 * 1024;
+
       if (e == PCRE_ERROR_JIT_STACKLIMIT
-          && 0 < pc->jit_stack_size && pc->jit_stack_size <= INT_MAX / 2)
+          && 0 < pc->jit_stack_size && pc->jit_stack_size <= jitstack_max / 2)
         {
           int old_size = pc->jit_stack_size;
           int new_size = pc->jit_stack_size = old_size * 2;

http://git.savannah.gnu.org/cgit/grep.git/commit/?id=c562691787709e5ebfec9f298f8d702efe8291b7


commit b3a85a1a8a816f4f6f9c01399c16efe92a86ca06
Author: Paul Eggert <eggert@cs.ucla.edu>
Date:   Tue Nov 9 10:11:42 2021 -0800

    grep: work around PCRE bug
    
    Problem reported by Carlo Marcelo Arenas Belón (Bug#51710).
    * src/pcresearch.c (jit_exec): Don’t attempt to grow the JIT stack
    over INT_MAX - 8 * 1024.

diff --git a/src/pcresearch.c b/src/pcresearch.c
index 3bdaee9..09f92c8 100644
--- a/src/pcresearch.c
+++ b/src/pcresearch.c
@@ -72,8 +72,11 @@ jit_exec (struct pcre_comp *pc, char const *subject, int 
search_bytes,
                          search_offset, options, sub, NSUB);
 
 #if PCRE_STUDY_JIT_COMPILE
+      /* Going over this would trigger an int overflow bug within PCRE.  */
+      int jitstack_max = INT_MAX - 8 * 1024;
+
       if (e == PCRE_ERROR_JIT_STACKLIMIT
-          && 0 < pc->jit_stack_size && pc->jit_stack_size <= INT_MAX / 2)
+          && 0 < pc->jit_stack_size && pc->jit_stack_size <= jitstack_max / 2)
         {
           int old_size = pc->jit_stack_size;
           int new_size = pc->jit_stack_size = old_size * 2;

-----------------------------------------------------------------------

Summary of changes:
 gnulib           | 2 +-
 src/pcresearch.c | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
grep



reply via email to

[Prev in Thread] Current Thread [Next in Thread]