From bd49a5c948c813fb8dee164fe45180bdebe24a9e Mon Sep 17 00:00:00 2001 From: Peter Howkins Date: Thu, 23 Dec 2021 19:54:18 +0000 Subject: [PATCH] dthelp: Resolve format-overflow issues --- cde/programs/dthelp/parser/canon1/helptag/help.c | 4 ++-- cde/programs/dthelp/parser/pass1/helptag/help.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cde/programs/dthelp/parser/canon1/helptag/help.c b/cde/programs/dthelp/parser/canon1/helptag/help.c index cebb308c7..7e9d02067 100644 --- a/cde/programs/dthelp/parser/canon1/helptag/help.c +++ b/cde/programs/dthelp/parser/canon1/helptag/help.c @@ -88,7 +88,7 @@ if ((m_argc > 2) && (strchr(m_argv[2], 'f') || strchr(m_argv[2], 'F'))) /* fills ``install'' with path to ourself */ { char *path, *cp; -char buf[200]; +char buf[BUFSIZ]; char patbuf[BUFSIZ]; int quit, none; @@ -138,7 +138,7 @@ else quit++; else *cp = '\0'; - sprintf(buf, "%s/%s", path, m_argv[0]); + snprintf(buf, sizeof(buf), "%s/%s", path, m_argv[0]); if (access(buf, 1) == 0) { diff --git a/cde/programs/dthelp/parser/pass1/helptag/help.c b/cde/programs/dthelp/parser/pass1/helptag/help.c index cdca41fd2..fb4be040e 100644 --- a/cde/programs/dthelp/parser/pass1/helptag/help.c +++ b/cde/programs/dthelp/parser/pass1/helptag/help.c @@ -89,7 +89,7 @@ if ((m_argc > 2) && (strchr(m_argv[2], 'f') || strchr(m_argv[2], 'F'))) /* fills ``install'' with path to ourself */ { char *path, *cp; -char buf[200]; +char buf[BUFSIZ]; char patbuf[BUFSIZ]; int quit, none; @@ -139,7 +139,7 @@ else quit++; else *cp = '\0'; - sprintf(buf, "%s/%s", path, m_argv[0]); + snprintf(buf, sizeof(buf), "%s/%s", path, m_argv[0]); if (access(buf, 1) == 0) {