From 2d5711961fa87b57a685046adcfc371aba5e72af Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sat, 11 Mar 2017 09:17:40 -0800 Subject: [PATCH] ETHER: Fix potential unterminated string (COVERITY) --- sim_ether.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sim_ether.c b/sim_ether.c index b8d6af6f..4b7b25d6 100644 --- a/sim_ether.c +++ b/sim_ether.c @@ -419,7 +419,7 @@ t_stat eth_mac_scan_ex (ETH_MAC* mac, const char* strmac, UNIT *uptr) strncpy (state.sim, sim_name, sizeof(state.sim)); getcwd (state.cwd, sizeof(state.cwd)); if (uptr) - strncpy (state.uname, sim_uname (uptr), sizeof(state.uname)); + strncpy (state.uname, sim_uname (uptr), sizeof(state.uname)-1); cptr = strchr (strmac, '>'); if (cptr) { state.file[sizeof(state.file)-1] = '\0';