From 14ed10fc3a257ae6f8775e53e0f49b7c0d26aa34 Mon Sep 17 00:00:00 2001 From: "Philip.Hazel" Date: Tue, 14 Oct 2014 16:41:13 +0000 Subject: [PATCH] Minor length bug. --- src/pcre2_string_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;