From: Peter Howkins Date: Wed, 4 Jul 2018 00:49:50 +0000 (+0100) Subject: dtprintinfo: Coverity 88650 X-Git-Tag: 2.3.0a~205 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1cd6ca09995907818b5fe6734bdd333e088f9385;p=oweals%2Fcde.git dtprintinfo: Coverity 88650 --- diff --git a/cde/programs/dtprintinfo/UI/DtPrinterIcon.C b/cde/programs/dtprintinfo/UI/DtPrinterIcon.C index 385f1d31..16ff6926 100644 --- a/cde/programs/dtprintinfo/UI/DtPrinterIcon.C +++ b/cde/programs/dtprintinfo/UI/DtPrinterIcon.C @@ -752,17 +752,17 @@ char *DtPrinterIcon::GetPrinterIcon(const char *printer, { static char buf[200]; - sprintf(buf, "%s_Print", printer); + snprintf(buf, sizeof(buf), "%s_Print", printer); if (_app_mode != INITIALIZE_PRINTERS && DtActionExists(buf)) { char *iconfile = DtActionIcon(buf); if (iconfile) - strcpy(buf, iconfile); + snprintf(buf, sizeof(buf), "%s", iconfile); else - strcpy(buf, PRINTER_ICON_FILE); + snprintf(buf, sizeof(buf), "%s", PRINTER_ICON_FILE); } else - strcpy(buf, PRINTER_ICON_FILE); + snprintf(buf, sizeof(buf), "%s", PRINTER_ICON_FILE); return buf; }