hplip/hplip-logdir.patch

25 lines
1.5 KiB
Diff
Raw Normal View History

diff -up hplip-3.18.12/prnt/hpcups/HPCupsFilter.cpp.logdir hplip-3.18.12/prnt/hpcups/HPCupsFilter.cpp
--- hplip-3.18.12/prnt/hpcups/HPCupsFilter.cpp.logdir 2019-01-08 12:31:15.346315031 +0100
+++ hplip-3.18.12/prnt/hpcups/HPCupsFilter.cpp 2019-01-08 12:47:42.314131260 +0100
@@ -643,7 +643,7 @@ int HPCupsFilter::processRasterData(cups
char hpPreProcessedRasterFile[MAX_FILE_PATH_LEN]; //temp file needed to store raster data with swaped pages.
- sprintf(hpPreProcessedRasterFile, "%s/hp_%s_cups_SwapedPagesXXXXXX",CUPS_TMP_DIR, m_JA.user_name);
+ snprintf(hpPreProcessedRasterFile, sizeof (hpPreProcessedRasterFile), "%s/hp_%s_cups_SwapedPagesXXXXXX",CUPS_TMP_DIR, m_JA.user_name);
image_processor_t* imageProcessor = imageProcessorCreate();
while (cupsRasterReadHeader2(cups_raster, &cups_header))
diff -up hplip-3.18.12/prnt/hpcups/SystemServices.cpp.logdir hplip-3.18.12/prnt/hpcups/SystemServices.cpp
--- hplip-3.18.12/prnt/hpcups/SystemServices.cpp.logdir 2018-12-03 08:07:13.000000000 +0100
+++ hplip-3.18.12/prnt/hpcups/SystemServices.cpp 2019-01-08 12:31:15.346315031 +0100
@@ -38,7 +38,7 @@ SystemServices::SystemServices(int iLogL
if (iLogLevel & SAVE_OUT_FILE)
{
char fname[MAX_FILE_PATH_LEN];
- sprintf(fname, "%s/hpcups_%s_out_job%d_XXXXXX",CUPS_TMP_DIR, user_name, job_id);
+ snprintf(fname, sizeof(fname), "%s/hpcups_%s_out_job%d_XXXXXX",CUPS_TMP_DIR, user_name, job_id);
createTempFile(fname, &m_fp);
if (m_fp)
{