fix off-by-one that trampled memory in re_croak2()
Gurusamy Sarathy [Thu, 18 Jun 1998 16:28:48 +0000 (16:28 +0000)]
p4raw-id: //depot/perl@1142

regcomp.c

index 73f504e..45f1e9a 100644 (file)
--- 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);