From 9a1c3a931301851cbb1b49a7f00a88351fbf2511 Mon Sep 17 00:00:00 2001 From: Stanislav Shwartsman Date: Sat, 23 Nov 2019 15:15:50 +0000 Subject: [PATCH] fixed buffer overflow warning --- bochs/gui/siminterface.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bochs/gui/siminterface.cc b/bochs/gui/siminterface.cc index aae5f109b..1701a8edc 100644 --- a/bochs/gui/siminterface.cc +++ b/bochs/gui/siminterface.cc @@ -1219,7 +1219,8 @@ static int bx_restore_getline(FILE *fp, char *line, int maxlen) bx_bool bx_real_sim_c::restore_bochs_param(bx_list_c *root, const char *sr_path, const char *restore_name) { char devstate[BX_PATHNAME_LEN], devdata[BX_PATHNAME_LEN]; - char line[512], buf[512], pname[80]; + char line[512], buf[512]; + char pname[81]; // take extra 81st character for /0 char *ptr; int i; unsigned n;