From: Rafael Garcia-Suarez Date: Mon, 31 Jan 2005 08:35:51 +0000 (+0000) Subject: Avoid a buffer overflow with threads and PERLIO_DEBUG X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e081bb54e0eecfb962e7f0cfd84fcbdb2683d54d;p=p5sagit%2Fp5-mst-13.2.git Avoid a buffer overflow with threads and PERLIO_DEBUG p4raw-id: //depot/perl@23904 --- diff --git a/perlio.c b/perlio.c index 19b842e..85bc755 100644 --- a/perlio.c +++ b/perlio.c @@ -472,7 +472,7 @@ PerlIO_debug(const char *fmt, ...) s = CopFILE(PL_curcop); if (!s) s = "(none)"; - sprintf(buffer, "%s:%" IVdf " ", s, (IV) CopLINE(PL_curcop)); + sprintf(buffer, "%.40s:%" IVdf " ", s, (IV) CopLINE(PL_curcop)); len = strlen(buffer); vsprintf(buffer+len, fmt, ap); PerlLIO_write(dbg, buffer, strlen(buffer));