From: VMware, Inc <> Date: Thu, 24 Feb 2011 22:46:53 +0000 (-0800) Subject: lib/file: Don't Panic X-Git-Tag: 2011.02.23-368700~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=edc550f9f7bdd4d076dccbe636f208e7a6de4d78;p=thirdparty%2Fopen-vm-tools.git lib/file: Don't Panic More UTF8 conversion panic protection. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/lib/file/filePosix.c b/open-vm-tools/lib/file/filePosix.c index 6cbbec0f8..230eeb3b5 100644 --- a/open-vm-tools/lib/file/filePosix.c +++ b/open-vm-tools/lib/file/filePosix.c @@ -2331,6 +2331,14 @@ File_ListDirectory(ConstUnicode pathName, // IN: STRING_ENCODING_DEFAULT)) { id = Unicode_Alloc(entry->d_name, STRING_ENCODING_DEFAULT); } else { + id = Unicode_EscapeBuffer(entry->d_name, -1, + STRING_ENCODING_DEFAULT); + + Warning("%s: file '%s' in directory '%s' cannot be converted to " + "UTF8\n", __FUNCTION__, pathName, id); + + Unicode_Free(id); + id = Unicode_Duplicate("\xEF\xBF\xBD\xEF\xBF\xBD\xEF\xBF\xBD"); }