From 7a95c46e3df56de3b6291c67802c2ad831e4e31d Mon Sep 17 00:00:00 2001 From: Erik Larsson Date: Thu, 9 Dec 2010 12:17:11 +0100 Subject: [PATCH] Bugfix for ntfs_mbstoucs_libntfscompat: Take the the \0 terminator into account when determining whether reallocing is necessary. --- ntfsprogs/utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ntfsprogs/utils.h b/ntfsprogs/utils.h index e16fdeb0..9fbb20b8 100644 --- a/ntfsprogs/utils.h +++ b/ntfsprogs/utils.h @@ -127,7 +127,7 @@ static __inline__ int ntfs_mbstoucs_libntfscompat(const char *ins, tmpstr_len = ntfs_mbstoucs(ins, &tmpstr); if(tmpstr_len >= 0) { - if(tmpstr_len > outs_len) { + if((tmpstr_len + 1) > outs_len) { /* Doing a realloc instead of reusing tmpstr * because it emulates libntfs's mbstoucs more * closely. */