diff --git a/hplip/prnt/hpcups/HPCupsFilter.cpp b/hplip/prnt/hpcups/HPCupsFilter.cpp index 5fbcff435..5f5afedd7 100644 --- a/hplip/prnt/hpcups/HPCupsFilter.cpp +++ b/hplip/prnt/hpcups/HPCupsFilter.cpp @@ -652,7 +652,7 @@ int HPCupsFilter::processRasterData(cups_raster_t *cups_raster) 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); #ifndef DISABLE_IMAGEPROCESSOR image_processor_t* imageProcessor=NULL; IMAGE_PROCESSOR_ERROR result; diff --git a/hplip/prnt/hpcups/SystemServices.cpp b/hplip/prnt/hpcups/SystemServices.cpp index f22783733..318e5391b 100644 --- a/hplip/prnt/hpcups/SystemServices.cpp +++ b/hplip/prnt/hpcups/SystemServices.cpp @@ -38,7 +38,7 @@ SystemServices::SystemServices(int iLogLevel, int job_id, char* user_name) : m_i 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) {