Blame SOURCES/hplip-strncpy.patch

b1d80f
diff -up hplip-3.14.10/prnt/hpcups/HPCupsFilter.cpp.strncpy hplip-3.14.10/prnt/hpcups/HPCupsFilter.cpp
b1d80f
--- hplip-3.14.10/prnt/hpcups/HPCupsFilter.cpp.strncpy	2015-01-21 16:52:44.066497631 +0000
b1d80f
+++ hplip-3.14.10/prnt/hpcups/HPCupsFilter.cpp	2015-01-21 16:59:46.216434376 +0000
b1d80f
@@ -203,6 +203,7 @@ HPCupsFilter::HPCupsFilter() : m_pPrinte
b1d80f
     adj_k_width = 0;
b1d80f
     black_raster = NULL;
b1d80f
     color_raster = NULL;
b1d80f
+    memset (&m_JA, 0, sizeof (m_JA));
b1d80f
 }
b1d80f
 
b1d80f
 HPCupsFilter::~HPCupsFilter()
b1d80f
@@ -384,9 +385,9 @@ DRIVER_ERROR HPCupsFilter::startPage (cu
b1d80f
         m_JA.media_attributes.physical_height = cups_header->PageSize[1];
b1d80f
         m_JA.media_attributes.printable_width = ((cups_header->ImagingBoundingBox[2]-cups_header->ImagingBoundingBox[0]) * horz_res) / 72;
b1d80f
         m_JA.media_attributes.printable_height = ((cups_header->ImagingBoundingBox[3]-cups_header->ImagingBoundingBox[1]) * vert_res) / 72;
b1d80f
-        strncpy(m_JA.media_attributes.PageSizeName, &cups_header->cupsString[0][0], sizeof(m_JA.media_attributes.PageSizeName));
b1d80f
-        strncpy(m_JA.media_attributes.MediaTypeName, cups_header->MediaType, sizeof(m_JA.media_attributes.MediaTypeName));
b1d80f
-        strncpy(m_JA.quality_attributes.hbpl1_print_quality, cups_header->OutputType, sizeof(m_JA.quality_attributes.hbpl1_print_quality));
b1d80f
+        strncpy(m_JA.media_attributes.PageSizeName, &cups_header->cupsString[0][0], sizeof(m_JA.media_attributes.PageSizeName)-1);
b1d80f
+        strncpy(m_JA.media_attributes.MediaTypeName, cups_header->MediaType, sizeof(m_JA.media_attributes.MediaTypeName)-1);
b1d80f
+        strncpy(m_JA.quality_attributes.hbpl1_print_quality, cups_header->OutputType, sizeof(m_JA.quality_attributes.hbpl1_print_quality)-1);
b1d80f
         m_JA.color_mode = cups_header->cupsRowStep;
b1d80f
     }
b1d80f
     else {
b1d80f
diff -up hplip-3.14.10/prnt/hpijs/hpijs.cpp.strncpy hplip-3.14.10/prnt/hpijs/hpijs.cpp
b1d80f
--- hplip-3.14.10/prnt/hpijs/hpijs.cpp.strncpy	2015-01-21 17:00:03.225512410 +0000
b1d80f
+++ hplip-3.14.10/prnt/hpijs/hpijs.cpp	2015-01-21 17:04:59.308870785 +0000
b1d80f
@@ -605,7 +605,7 @@ int main (int argc, char *argv[], char *
b1d80f
    }
b1d80f
 
b1d80f
    if (argc > 2)
b1d80f
-        strncpy(user_name, argv[2], sizeof(user_name));
b1d80f
+        strncpy(user_name, argv[2], sizeof(user_name) - 1);
b1d80f
 
b1d80f
 #ifdef HAVE_LIBHPIP
b1d80f
    char *pDev;
b1d80f
diff -up hplip-3.14.10/prnt/hpijs/hpijsfax.cpp.strncpy hplip-3.14.10/prnt/hpijs/hpijsfax.cpp
b1d80f
--- hplip-3.14.10/prnt/hpijs/hpijsfax.cpp.strncpy	2015-01-21 17:05:06.585904171 +0000
b1d80f
+++ hplip-3.14.10/prnt/hpijs/hpijsfax.cpp	2015-01-21 17:05:15.787946389 +0000
b1d80f
@@ -282,7 +282,7 @@ int hpijsFaxServer (int argc, char **arg
b1d80f
 	char user_name[32]={0,};
b1d80f
 
b1d80f
    if (argc > 2)
b1d80f
-        strncpy(user_name, argv[2], sizeof(user_name));
b1d80f
+        strncpy(user_name, argv[2], sizeof(user_name) - 1);
b1d80f
 
b1d80f
     snprintf(hpFileName,sizeof(hpFileName),"%s/hp_%s_ijsfax_Log_XXXXXX",CUPS_TMP_DIR, user_name);
b1d80f