LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File enscript-1.6.4-CAN-2004-1186.patch of Package enscript (Project openSUSE:11.4)

diff -u -p -Nr --exclude CVS enscript-1.6.3.CAN-2004-1185/src/psgen.c enscript-1.6.3.CAN-2004-1186/src/psgen.c
--- enscript-1.6.3.CAN-2004-1185/src/psgen.c	2005-01-05 15:22:40.000000000 +0100
+++ enscript-1.6.3.CAN-2004-1186/src/psgen.c	2005-01-05 15:22:44.000000000 +0100
@@ -2034,8 +2034,9 @@ dump_ps_page_header (char *fname, int em
   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)