From: Jarkko Hietaniemi Date: Sat, 23 Mar 2002 01:00:31 +0000 (+0000) Subject: Purify: Array bounds write: pre-extend the strxfrm X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=37cda61e6cf9e214e2616d0104296009da3b1231;p=p5sagit%2Fp5-mst-13.2.git Purify: Array bounds write: pre-extend the strxfrm buffer by a factor of four (suggested maximum by HP-UX; Solaris suggests using 1 + strxfrm(NULL, s, 0) but I don't know how portable that is; locale.c uses yet another trick (not a particularly good trick, I might add)) p4raw-id: //depot/perl@15435 --- diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index 238c528..2d1abf3 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -1568,7 +1568,7 @@ strxfrm(src) STRLEN dstlen; char *p = SvPV(src,srclen); srclen++; - ST(0) = sv_2mortal(NEWSV(800,srclen)); + ST(0) = sv_2mortal(NEWSV(800,srclen*4+1)); dstlen = strxfrm(SvPVX(ST(0)), p, (size_t)srclen); if (dstlen > srclen) { dstlen++;