diff options
author | ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> | 2020-02-24 15:39:56 +0000 |
---|---|---|
committer | ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> | 2020-02-24 15:39:56 +0000 |
commit | 9af350af12899021537ce50c25ba98bdd7c1e5ee (patch) | |
tree | ca0449e427ce508d05415a7776b05688f49ae465 /src | |
parent | d1125270b0e74ff196824dfb2d3a4e9793e6d6d4 (diff) | |
download | pcre2-9af350af12899021537ce50c25ba98bdd7c1e5ee.tar.gz |
Fix bug in UTF-16 checker returning wrong offset for missing low surrogate.
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@1226 6239d852-aaf2-0410-a92c-79f79f948069
Diffstat (limited to 'src')
-rw-r--r-- | src/pcre2_valid_utf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pcre2_valid_utf.c b/src/pcre2_valid_utf.c index 96e8bff..e47ea78 100644 --- a/src/pcre2_valid_utf.c +++ b/src/pcre2_valid_utf.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-2020 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -347,7 +347,7 @@ for (p = string; length > 0; p++) length--; if ((*p & 0xfc00) != 0xdc00) { - *erroroffset = p - string; + *erroroffset = p - string - 1; return PCRE2_ERROR_UTF16_ERR2; } } |