From: Peter Howkins Date: Wed, 4 Jul 2018 00:51:43 +0000 (+0100) Subject: dtprintinfo: Coverity 88683 X-Git-Tag: 2.3.0a~204 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=445019f086f36a6f560140be0147e9c260315044;p=oweals%2Fcde.git dtprintinfo: Coverity 88683 --- diff --git a/cde/programs/dtprintinfo/UI/DtPrinterIcon.C b/cde/programs/dtprintinfo/UI/DtPrinterIcon.C index 16ff6926..51f79bef 100644 --- a/cde/programs/dtprintinfo/UI/DtPrinterIcon.C +++ b/cde/programs/dtprintinfo/UI/DtPrinterIcon.C @@ -771,16 +771,16 @@ char *DtPrinterIcon::GetPrinterLabel(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 *label = DtActionLabel(buf); if (label) - strcpy(buf, label); + snprintf(buf, sizeof(buf), "%s", label); else - strcpy(buf, printer); + snprintf(buf, sizeof(buf), "%s", printer); } else - strcpy(buf, printer); + snprintf(buf, sizeof(buf), "%s", printer); return buf; }