From 52d5e40f934237b40b7ea2a1e3133701ac2b3c6b Mon Sep 17 00:00:00 2001 From: jpandre Date: Wed, 9 Dec 2009 10:48:35 +0000 Subject: [PATCH] Fixed memory allocation for translating junction points --- libntfs-3g/reparse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libntfs-3g/reparse.c b/libntfs-3g/reparse.c index 164aed2b..69e8f0c6 100644 --- a/libntfs-3g/reparse.c +++ b/libntfs-3g/reparse.c @@ -598,7 +598,7 @@ static char *ntfs_get_fulllink(ntfs_volume *vol, ntfschar *junction, if (*p == '/') level++; fulltarget = (char*)ntfs_malloc(3*level - + sizeof(mappingdir) + count - 4); + + sizeof(mappingdir) + strlen(target) - 3); if (fulltarget) { fulltarget[0] = 0; if (level > 1) { @@ -721,7 +721,7 @@ static char *ntfs_get_abslink(ntfs_volume *vol, ntfschar *junction, if (*p == '/') level++; fulltarget = (char*)ntfs_malloc(3*level - + sizeof(mappingdir) + count - 4); + + sizeof(mappingdir) + strlen(target) - 3); if (fulltarget) { fulltarget[0] = 0; if (level > 1) {