Fix invalid ioengine initialization for cpp_null
authorTomohiro Kusumi <tkusumi@tuxera.com>
Thu, 5 Jan 2017 17:32:16 +0000 (02:32 +0900)
committerJens Axboe <axboe@fb.com>
Thu, 5 Jan 2017 17:35:44 +0000 (10:35 -0700)
->name is a pointer now, so it can't be strcpy'd without a valid
address set to ->name.

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
engines/null.c

index f7ba37048244b6683d6c4dd2c2fcceaefb6efe8b..4378f5e2f8ec21d3d7c51f0758b9532af13bb564 100644 (file)
@@ -142,7 +142,7 @@ void get_ioengine(struct ioengine_ops **ioengine_ptr)
        *ioengine_ptr = (struct ioengine_ops *) malloc(sizeof(struct ioengine_ops));
        ioengine = *ioengine_ptr;
 
-       strcpy(ioengine->name, "cpp_null");
+       ioengine->name           = "cpp_null";
        ioengine->version        = FIO_IOOPS_VERSION;
        ioengine->queue          = fio_null_queue;
        ioengine->commit         = fio_null_commit;