[PATCH] String copy limiting fixes
[fio.git] / ioengines.c
index 115e6f2c7c96ae22322225f0c2097aa8ab9418e0..96a96360750038ea87909c8fdfd45f36a89c9d13 100644 (file)
@@ -42,13 +42,13 @@ static int check_engine_ops(struct ioengine_ops *ops)
        return 0;
 }
 
-struct ioengine_ops *load_ioengine(struct thread_data *td, char *name)
+struct ioengine_ops *load_ioengine(struct thread_data *td, const char *name)
 {
        char engine[16], engine_lib[256];
        struct ioengine_ops *ops, *ret;
        void *dlhandle;
 
-       strcpy(engine, name);
+       strncpy(engine, name, sizeof(engine) - 1);
 
        /*
         * linux libaio has alias names, so convert to what we want