From acc35f3fa2a9755a43ec5c4e83d58d88983634c1 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sat, 21 Feb 2015 16:22:01 +0100 Subject: zfs/mzap_lookup: Fix argument types Origin: upstream, http://git.savannah.gnu.org/cgit/grub.git/commit/?id=87a04adb6541c4bf169644bb2f84036a7c8558dd Last-Update: 2016-01-22 Patch-Name: zfs-mzap-lookup-argument-types.patch --- grub-core/fs/zfs/zfs.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/grub-core/fs/zfs/zfs.c b/grub-core/fs/zfs/zfs.c index e00a980..da8fd56 100644 --- a/grub-core/fs/zfs/zfs.c +++ b/grub-core/fs/zfs/zfs.c @@ -2010,12 +2010,14 @@ dmu_read (dnode_end_t * dn, grub_uint64_t blkid, void **buf, */ static grub_err_t mzap_lookup (mzap_phys_t * zapobj, grub_zfs_endian_t endian, - int objsize, const char *name, grub_uint64_t * value, + grub_uint16_t objsize, const char *name, grub_uint64_t * value, int case_insensitive) { - int i, chunks; + grub_uint16_t i, chunks; mzap_ent_phys_t *mzap_ent = zapobj->mz_chunk; + if (objsize < MZAP_ENT_LEN) + return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), name); chunks = objsize / MZAP_ENT_LEN - 1; for (i = 0; i < chunks; i++) { @@ -2423,7 +2425,7 @@ zap_lookup (dnode_end_t * zap_dnode, const char *name, grub_uint64_t *val, struct grub_zfs_data *data, int case_insensitive) { grub_uint64_t block_type; - int size; + grub_uint16_t size; void *zapbuf; grub_err_t err; grub_zfs_endian_t endian;