[PATCH] Fix memswp. Its scratch space was too small
[fio.git] / verify.c
index d9a68d656e490ca2d9a3e0b6a76777895e08f045..6f67dffa6898692f8359abb98a6ddc93f07f3db3 100644 (file)
--- a/verify.c
+++ b/verify.c
@@ -83,7 +83,9 @@ static void fill_pattern(struct thread_data *td, void *p, unsigned int len)
 
 static void memswp(void* buf1, void* buf2, unsigned int len)
 {
-       struct verify_header swap;
+       char swap[200];
+
+       assert(len <= sizeof(swap));
 
        memcpy(&swap, buf1, len);
        memcpy(buf1, buf2, len);