libtt/db_server_svc.C: coverity CID 87060; string overflow
authorJon Trulson <jon@radscan.com>
Sun, 1 Apr 2018 00:02:11 +0000 (18:02 -0600)
committerJon Trulson <jon@radscan.com>
Sun, 1 Apr 2018 00:02:11 +0000 (18:02 -0600)
cde/lib/tt/bin/ttdbserverd/db_server_svc.C

index fbec3d4184c56c5afdd1bff189c42473ea66490c..e01c6155ed9dbc26fb3aa39f1c2cf684306f27f0 100644 (file)
@@ -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) {