aboutsummaryrefslogtreecommitdiff
path: root/lib/sqfs/data_writer/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqfs/data_writer/common.c')
-rw-r--r--lib/sqfs/data_writer/common.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/sqfs/data_writer/common.c b/lib/sqfs/data_writer/common.c
index 059ef41..a19eb6d 100644
--- a/lib/sqfs/data_writer/common.c
+++ b/lib/sqfs/data_writer/common.c
@@ -157,9 +157,13 @@ int sqfs_data_writer_write_fragment_table(sqfs_data_writer_t *proc,
return 0;
}
-void sqfs_data_writer_set_hooks(sqfs_data_writer_t *proc, void *user_ptr,
- const sqfs_block_hooks_t *hooks)
+int sqfs_data_writer_set_hooks(sqfs_data_writer_t *proc, void *user_ptr,
+ const sqfs_block_hooks_t *hooks)
{
+ if (hooks->size != sizeof(*hooks))
+ return SQFS_ERROR_UNSUPPORTED;
+
proc->hooks = hooks;
proc->user_ptr = user_ptr;
+ return 0;
}