From b2f1496a36e68565421bd21485605d6af2a5819f Mon Sep 17 00:00:00 2001 From: ph10 Date: Mon, 27 Mar 2017 16:00:16 +0000 Subject: [PATCH] Fix typo (leading to possible buffer overflow in pcre_copy_substring()) in pcretest. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1691 2f5784b3-3f2a-0410-8824-cb99058d5e15 Petr Písař: Ported to 8.40. --- pcretest.c | 4 ++-- diff --git a/pcretest.c b/pcretest.c index 0a153be..26578e1 100644 --- a/pcretest.c +++ b/pcretest.c @@ -426,11 +426,11 @@ argument, the casting might be incorrectly applied. */ #define PCRE_COPY_NAMED_SUBSTRING32(rc, re, bptr, offsets, count, \ namesptr, cbuffer, size) \ rc = pcre32_copy_named_substring((pcre32 *)re, (PCRE_SPTR32)bptr, offsets, \ - count, (PCRE_SPTR32)namesptr, (PCRE_UCHAR32 *)cbuffer, size/2) + count, (PCRE_SPTR32)namesptr, (PCRE_UCHAR32 *)cbuffer, size/4) #define PCRE_COPY_SUBSTRING32(rc, bptr, offsets, count, i, cbuffer, size) \ rc = pcre32_copy_substring((PCRE_SPTR32)bptr, offsets, count, i, \ - (PCRE_UCHAR32 *)cbuffer, size/2) + (PCRE_UCHAR32 *)cbuffer, size/4) #define PCRE_DFA_EXEC32(count, re, extra, bptr, len, start_offset, options, \ offsets, size_offsets, workspace, size_workspace) \ -- 2.7.4