Revision: 111
http://www.exim.org/viewvc/pcre2?view=rev&revision=111
Author: ph10
Date: 2014-10-14 17:41:13 +0100 (Tue, 14 Oct 2014)
Log Message:
-----------
Minor length bug.
Modified Paths:
--------------
code/trunk/src/pcre2_string_utils.c
Modified: code/trunk/src/pcre2_string_utils.c
===================================================================
--- code/trunk/src/pcre2_string_utils.c 2014-10-14 16:23:57 UTC (rev 110)
+++ code/trunk/src/pcre2_string_utils.c 2014-10-14 16:41:13 UTC (rev 111)
@@ -195,7 +195,7 @@
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;