]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Crash during File_WalkDirectoryNext
authorOliver Kurth <okurth@vmware.com>
Mon, 3 Jun 2019 20:39:44 +0000 (13:39 -0700)
committerOliver Kurth <okurth@vmware.com>
Mon, 3 Jun 2019 20:39:44 +0000 (13:39 -0700)
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.

open-vm-tools/lib/file/filePosix.c

index be6e4908f68937acc922a3e8f9d9e8a9af0827a4..70a0f14d8f0cffc0116e060af2f3d473a02b6e37 100644 (file)
@@ -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);