From: Gurusamy Sarathy Date: Thu, 18 Jun 1998 16:28:48 +0000 (+0000) Subject: fix off-by-one that trampled memory in re_croak2() X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3b818b81e61465ce5ae6f7c21e6ca3b83d30216e;p=p5sagit%2Fp5-mst-13.2.git fix off-by-one that trampled memory in re_croak2() p4raw-id: //depot/perl@1142 --- diff --git a/regcomp.c b/regcomp.c index 73f504e..45f1e9a 100644 --- a/regcomp.c +++ b/regcomp.c @@ -2569,8 +2569,8 @@ re_croak2(const char* pat1,const char* pat2,...) l2 = 510 - l1; Copy(pat1, buf, l1 , char); Copy(pat2, buf + l1, l2 , char); - buf[l1 + l2 + 1] = '\n'; - buf[l1 + l2 + 2] = '\0'; + buf[l1 + l2] = '\n'; + buf[l1 + l2 + 1] = '\0'; va_start(args, pat2); message = mess(buf, &args); va_end(args);