strcpy: kill last of the suspect ones
[fio.git] / stat.c
diff --git a/stat.c b/stat.c
index fbf0118c6d7ae1a4a895dc450cf808be7db4041c..3adb46eab8087cc53ae0fd2b7c15ad048596c040 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -1272,10 +1272,12 @@ static void __show_run_stats(void)
                        if (!td->error && td->o.continue_on_error &&
                            td->first_error) {
                                ts->error = td->first_error;
-                               strcpy(ts->verror, td->verror);
+                               ts->verror[sizeof(ts->verror) - 1] = '\0';
+                               strncpy(ts->verror, td->verror, sizeof(ts->verror) - 1);
                        } else  if (td->error) {
                                ts->error = td->error;
-                               strcpy(ts->verror, td->verror);
+                               ts->verror[sizeof(ts->verror) - 1] = '\0';
+                               strncpy(ts->verror, td->verror, sizeof(ts->verror) - 1);
                        }
                }