From: Jarkko Hietaniemi Date: Thu, 21 Jun 2001 21:38:38 +0000 (+0000) Subject: Off-by-one. I'm so classic. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e0ac4f5fe723dae5ff9e639384ba416597f0f300;p=p5sagit%2Fp5-mst-13.2.git Off-by-one. I'm so classic. p4raw-id: //depot/perl@10801 --- diff --git a/util.c b/util.c index d0d8454..feef339 100644 --- a/util.c +++ b/util.c @@ -3616,7 +3616,7 @@ Perl_sv_getcwd(pTHX_ register SV *sv) SvPOK_off(sv); New(0, buf, MAXPATHLEN, char); if (buf) { - buf[MAXPATHLEN] = 0; + buf[MAXPATHLEN - 1] = 0; /* Yes, some getcwd()s automatically allocate a buffer * if given a NULL one. Portability is the problem. * XXX Configure probe needed. */