From: Oliver Kurth Date: Mon, 3 Jun 2019 20:39:44 +0000 (-0700) Subject: Crash during File_WalkDirectoryNext X-Git-Tag: stable-11.0.0~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f37292f0a8524783888d55f57fa30bb828e2408b;p=thirdparty%2Fopen-vm-tools.git Crash during File_WalkDirectoryNext In the rewrite of File_WalkDirectoryNext, a bug was introduced in the invalid Unicode path. Invalid Unicode occurs very rarely... and the bug finally turned up. Fix this... the bug is rather obvious. --- diff --git a/open-vm-tools/lib/file/filePosix.c b/open-vm-tools/lib/file/filePosix.c index be6e4908f..70a0f14d8 100644 --- a/open-vm-tools/lib/file/filePosix.c +++ b/open-vm-tools/lib/file/filePosix.c @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2006-2018 VMware, Inc. All rights reserved. + * Copyright (C) 2006-2019 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -3053,7 +3053,8 @@ File_WalkDirectoryNext(WalkDirContext context, // IN: allocName = Unicode_Alloc(entry->d_name, STRING_ENCODING_DEFAULT); #endif } else { - char *id = Unicode_EscapeBuffer(fileName, -1, STRING_ENCODING_DEFAULT); + char *id = Unicode_EscapeBuffer(entry->d_name, -1, + STRING_ENCODING_DEFAULT); Warning("%s: file '%s' in directory '%s' cannot be converted to " "UTF8\n", __FUNCTION__, context->dirName, id);