summaryrefslogtreecommitdiff
path: root/src/pcre2_string_utils.c
diff options
context:
space:
mode:
authorph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2014-10-14 16:41:13 +0000
committerph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2014-10-14 16:41:13 +0000
commite3f94a3d72e227db4f730363ee52b70781a3bf45 (patch)
tree45e9a7402fb57ad3f468476212f72458fbd03792 /src/pcre2_string_utils.c
parent48a3f40008b68ce52439689fcd56a937543a9e1d (diff)
downloadpcre2-e3f94a3d72e227db4f730363ee52b70781a3bf45.tar.gz
Minor length bug.
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@111 6239d852-aaf2-0410-a92c-79f79f948069
Diffstat (limited to 'src/pcre2_string_utils.c')
-rw-r--r--src/pcre2_string_utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pcre2_string_utils.c b/src/pcre2_string_utils.c
index 1a6864b..8f815cc 100644
--- a/src/pcre2_string_utils.c
+++ b/src/pcre2_string_utils.c
@@ -195,7 +195,7 @@ int
PRIV(strcpy_c8)(PCRE2_UCHAR *str1, size_t length, const char *str2)
{
PCRE2_UCHAR *t = str1;
-if (strlen(str2) >= length) return PCRE2_ERROR_BADLENGTH;
+if (strlen(str2) >= length - 1) return PCRE2_ERROR_BADLENGTH;
while (*str2 != 0) *t++ = *str2++;
*t = 0;
return t - str1;