pack('w') 64-bit buffer overflow
Dave Mitchell [Sun, 24 Mar 2002 22:23:08 +0000 (22:23 +0000)]
Message-ID: <20020324222308.B21963@fdgroup.com>

p4raw-id: //depot/perl@15478

pp_pack.c

index 7df5f45..67f53e7 100644 (file)
--- a/pp_pack.c
+++ b/pp_pack.c
@@ -2176,7 +2176,7 @@ Perl_pack_cat(pTHX_ SV *cat, char *pat, register char *patend, register SV **beg
                    against UV_MAX_P1.  */
                if (SvIOK(fromstr) || adouble < UV_MAX_P1)
                {
-                   char   buf[1 + sizeof(UV)];
+                   char   buf[(sizeof(UV)*8)/7+1];
                    char  *in = buf + sizeof(buf);
                    UV     auv = SvUV(fromstr);