From 6cd0391409b12e7d6da98366a4675abd77fdf721 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Sat, 31 Mar 2018 18:02:11 -0600 Subject: [PATCH] libtt/db_server_svc.C: coverity CID 87060; string overflow --- cde/lib/tt/bin/ttdbserverd/db_server_svc.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cde/lib/tt/bin/ttdbserverd/db_server_svc.C b/cde/lib/tt/bin/ttdbserverd/db_server_svc.C index fbec3d41..e01c6155 100644 --- a/cde/lib/tt/bin/ttdbserverd/db_server_svc.C +++ b/cde/lib/tt/bin/ttdbserverd/db_server_svc.C @@ -155,7 +155,7 @@ extern int optind; void sig_handler(int sig); -enum {STARTED_FROM_INETD, STARTED_FROM_SHELL} start_mode; +static enum {STARTED_FROM_INETD, STARTED_FROM_SHELL} start_mode; // // This is used to hold the next time the automatic garbage @@ -632,7 +632,7 @@ _tt_process_transaction() UNLOCK_RPC(); return; } - strcpy(_tt_target_db, _tt_log_buf); + snprintf(_tt_target_db, MAXPATHLEN, "%s", _tt_log_buf); /* open the NetISAM transaction target database */ int isfd = cached_isopen(_tt_target_db, ISINOUT+ISFIXLEN+ISMANULOCK); if (isfd == -1) { -- 2.25.1