t/read-to-pipe-async: Complain if option -f is specified multiple times
[fio.git] / verify.c
index f79ab43aab6b97b0721f52485fad31053e8d6ca9..37d2be8dd9403c6a2bede3c61079214abe971cac 100644 (file)
--- a/verify.c
+++ b/verify.c
@@ -1191,6 +1191,10 @@ static void populate_hdr(struct thread_data *td, struct io_u *io_u,
 
        fill_hdr(td, io_u, hdr, header_num, header_len, io_u->rand_seed);
 
+       if (header_len <= hdr_size(td, hdr)) {
+               td_verror(td, EINVAL, "Blocksize too small");
+               return;
+       }
        data_len = header_len - hdr_size(td, hdr);
 
        data = p + hdr_size(td, hdr);
@@ -1635,8 +1639,7 @@ struct all_io_list *get_all_io_list(int save_mask, size_t *sz)
                        s->rand.state32.s[3] = 0;
                        s->rand.use64 = 0;
                }
-               s->name[sizeof(s->name) - 1] = '\0';
-               strncpy((char *) s->name, td->o.name, sizeof(s->name) - 1);
+               snprintf((char *) s->name, sizeof(s->name), "%s", td->o.name);
                next = io_list_next(s);
        }