This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
patch@26561 & earlier - buffer overrun in VMS.C
authorJohn E. Malmberg <wb8tyw@qsl.net>
Mon, 2 Jan 2006 14:05:43 +0000 (09:05 -0500)
committerCraig A. Berry <craigberry@mac.com>
Mon, 2 Jan 2006 19:22:52 +0000 (19:22 +0000)
From: "John E. Malmberg" <wb8tyw@qsl.net>
Message-id: <43B97987.70201@qsl.net>

p4raw-id: //depot/perl@26581

vms/vms.c

index a914506..ac47224 100644 (file)
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -4830,7 +4830,7 @@ static char *mp_do_fileify_dirspec(pTHX_ const char *dir,char *buf,int ts)
           else retspec = __fileify_retbuf;
           cp1 = esa;
           cp2 = retspec;
-          while (*cp1 != ':') *(cp2++) = *(cp1++);
+          while ((*cp1 != ':')  && (*cp1 != '\0')) *(cp2++) = *(cp1++);
           strcpy(cp2,":[000000]");
           cp1 += 2;
           strcpy(cp2+9,cp1);