components/enscript/patches/enscript-1.6.1-CAN-2004-1186.patch
author Kristina Tripp <Kristina.Tripp@oracle.com>
Thu, 09 Oct 2014 15:53:40 -0700
branchs11-update
changeset 3378 8c7eb3630145
parent 2723 138732f62341
permissions -rw-r--r--
PSARC/2014/275 Hiera 1.3.4 19137944 Add hiera to userland consolidation 19623766 hiera-19 package not installed if ruby-19 not installed

--- enscript-1.6.1/src/psgen.c.CAN-2004-1186	2005-01-10 15:57:07.432740602 +0000
+++ enscript-1.6.1/src/psgen.c	2005-01-10 15:58:24.606016206 +0000
@@ -1914,8 +1914,9 @@
   else
     {
       ftail++;
-      strncpy (buf, fname, ftail - fname);
-      buf[ftail - fname] = '\0';
+      i = ftail - fname >= sizeof (buf)-1 ? sizeof (buf)-1 : ftail - fname;
+      strncpy (buf, fname, i);
+      buf[i] = '\0';
     }
 
   if (nup > 1)