summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/pcre2/src/pcre2_substring.c
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2018-10-01 12:24:08 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2019-01-22 14:11:18 +0000
commit159f7e9c39c57177d25f524ae3cad4e533b89da8 (patch)
tree4137f7a27464b2f9572f3dab899786ec01c8656f /src/3rdparty/pcre2/src/pcre2_substring.c
parent94aa7dabd234981ebc5893e1b8154ac990ccbe44 (diff)
Upgrade PCRE2 to 10.32
Squashed cherry pick of: e39a9de3309f84be4101da839a0bacf69090706f a7bcd16c750fb2ed36522719237af8ce3be94fa2 3bac18da8ef9f5750207ddf47192b5db3137c4ac 44eeeb8e816fbdcd77ad734cfe7a7ec28da1c5ed [ChangeLog][Third-Party Code] PCRE2 was updated to version 10.32. Change-Id: Id3bf7df0003f626cd1135d0508a5a489ff02f1e5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/3rdparty/pcre2/src/pcre2_substring.c')
-rw-r--r--src/3rdparty/pcre2/src/pcre2_substring.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/3rdparty/pcre2/src/pcre2_substring.c b/src/3rdparty/pcre2/src/pcre2_substring.c
index f6d7c39722..ddf5774e15 100644
--- a/src/3rdparty/pcre2/src/pcre2_substring.c
+++ b/src/3rdparty/pcre2/src/pcre2_substring.c
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge
- New API code Copyright (c) 2016 University of Cambridge
+ New API code Copyright (c) 2016-2018 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -414,7 +414,12 @@ else
for (i = 0; i < count2; i += 2)
{
size = (ovector[i+1] > ovector[i])? (ovector[i+1] - ovector[i]) : 0;
- memcpy(sp, match_data->subject + ovector[i], CU2BYTES(size));
+
+ /* Size == 0 includes the case when the capture is unset. Avoid adding
+ PCRE2_UNSET to match_data->subject because it overflows, even though with
+ zero size calling memcpy() is harmless. */
+
+ if (size != 0) memcpy(sp, match_data->subject + ovector[i], CU2BYTES(size));
*listp++ = sp;
if (lensp != NULL) *lensp++ = size;
sp += size;