From b249243a9f8d6ed246b0b873fe606066a6d712ed Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 4 Feb 2019 13:39:51 -0800 Subject: Fix allocation size --- extmod/vfs_fat_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'extmod/vfs_fat_file.c') diff --git a/extmod/vfs_fat_file.c b/extmod/vfs_fat_file.c index 4c38a35e5..1b2bb27f8 100644 --- a/extmod/vfs_fat_file.c +++ b/extmod/vfs_fat_file.c @@ -205,7 +205,7 @@ STATIC mp_obj_t file_open(fs_user_mount_t *vfs, const mp_obj_type_t *type, mp_ar o->fp.cltbl = temp_table; f_lseek(&o->fp, CREATE_LINKMAP); DWORD size = (temp_table[0] + 1) * 2; - o->fp.cltbl = m_malloc_maybe(size, false); + o->fp.cltbl = m_malloc_maybe(size * sizeof(DWORD), false); if (o->fp.cltbl != NULL) { o->fp.cltbl[0] = size; res = f_lseek(&o->fp, CREATE_LINKMAP); -- cgit v1.2.3