From d2e639dd5a5586e1daad32d30624d98c2805ffb6 Mon Sep 17 00:00:00 2001 From: Paul Eggert
Date: Fri, 16 Dec 2016 09:34:02 -0800 Subject: [PATCH] regex: fix integer-overflow bug in never-used code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem reported by Clément Pit–Claudel in: http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00654.html * lib/regex_internal.h: Include intprops.h. * lib/regexec.c (re_search_2_stub): Use it to avoid undefined behavior on integer overflow. * modules/regex (Depends-on): Add intprops. --- ChangeLog | 8 ++++++++ lib/regex_internal.h | 2 ++ lib/regexec.c | 6 ++++-- modules/regex | 1 + 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index dd67dba..c588296 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2016-12-16 Paul Eggert + regex: fix integer-overflow bug in never-used code + Problem reported by Clément Pit–Claudel in: + http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00654.html + * lib/regex_internal.h: Include intprops.h. + * lib/regexec.c (re_search_2_stub): Use it to avoid undefined + behavior on integer overflow. + * modules/regex (Depends-on): Add intprops. + fpending: fix port to MinGW on Emacs * lib/stdio-impl.h [__MINGW32__]: Do not include errno.h. Problem reported by Eli Zaretskii in: diff --git a/lib/regex_internal.h b/lib/regex_internal.h index 56a315a..7ac5f92 100644 --- a/lib/regex_internal.h +++ b/lib/regex_internal.h @@ -33,6 +33,8 @@ #include