From e81fd0ee2a649d1dfddbee0627d5f38757ae106a Mon Sep 17 00:00:00 2001 From: Erik Larsson Date: Thu, 9 Dec 2010 12:15:50 +0100 Subject: [PATCH] Important bugfix for ntfs_mbstoucs_libntfscompat: We reallocated too little memory. --- ntfsprogs/utils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ntfsprogs/utils.h b/ntfsprogs/utils.h index ce7281dc..e16fdeb0 100644 --- a/ntfsprogs/utils.h +++ b/ntfsprogs/utils.h @@ -131,8 +131,8 @@ static __inline__ int ntfs_mbstoucs_libntfscompat(const char *ins, /* Doing a realloc instead of reusing tmpstr * because it emulates libntfs's mbstoucs more * closely. */ - ntfschar *re_outs = - realloc(*outs, tmpstr_len + 1); + ntfschar *re_outs = realloc(*outs, + sizeof(ntfschar)*(tmpstr_len + 1)); if(!re_outs) tmpstr_len = -1; else