Fixed memory allocation for translating junction points

This commit is contained in:
jpandre 2009-12-09 10:48:35 +00:00
parent e5a1325ed3
commit 52d5e40f93

View File

@ -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) {