summaryrefslogtreecommitdiff
path: root/thirdparty/pcre2/src/pcre2_convert.c
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-03-04 16:14:25 +0100
committerGitHub <noreply@github.com>2019-03-04 16:14:25 +0100
commitfcabdf9e8351fef3ad50fea48e9c1f8420e6421e (patch)
treec5c156c6dbf9c261d5e9422fe05b2d663b02375f /thirdparty/pcre2/src/pcre2_convert.c
parentf173f8625d9a559b8a078bf5c4ba85ab36a2f222 (diff)
parent0455bc64b62154b7b966c598a80ec2eb4f66d088 (diff)
Merge pull request #26585 from akien-mga/pcre2-10.32
pcre2: Sync with upstream 10.32
Diffstat (limited to 'thirdparty/pcre2/src/pcre2_convert.c')
-rw-r--r--thirdparty/pcre2/src/pcre2_convert.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/thirdparty/pcre2/src/pcre2_convert.c b/thirdparty/pcre2/src/pcre2_convert.c
index bdf9b86df6..1dd5c337dc 100644
--- a/thirdparty/pcre2/src/pcre2_convert.c
+++ b/thirdparty/pcre2/src/pcre2_convert.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-2017 University of Cambridge
+ New API code Copyright (c) 2016-2018 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -1066,11 +1066,12 @@ BOOL utf = (options & PCRE2_CONVERT_UTF) != 0;
uint32_t pattype = options & TYPE_OPTIONS;
if (pattern == NULL || bufflenptr == NULL) return PCRE2_ERROR_NULL;
+
if ((options & ~ALL_OPTIONS) != 0 || /* Undefined bit set */
(pattype & (~pattype+1)) != pattype || /* More than one type set */
pattype == 0) /* No type set */
{
- *bufflenptr = 0; /* Error offset */
+ *bufflenptr = 0; /* Error offset */
return PCRE2_ERROR_BADOPTION;
}
@@ -1081,7 +1082,11 @@ if (ccontext == NULL) ccontext =
/* Check UTF if required. */
#ifndef SUPPORT_UNICODE
-if (utf) return PCRE2_ERROR_UNICODE_NOT_SUPPORTED;
+if (utf)
+ {
+ *bufflenptr = 0; /* Error offset */
+ return PCRE2_ERROR_UNICODE_NOT_SUPPORTED;
+ }
#else
if (utf && (options & PCRE2_CONVERT_NO_UTF_CHECK) == 0)
{
@@ -1126,6 +1131,7 @@ for (i = 0; i < 2; i++)
break;
default:
+ *bufflenptr = 0; /* Error offset */
return PCRE2_ERROR_INTERNAL;
}