From: VMware, Inc <> Date: Mon, 26 Apr 2010 18:22:02 +0000 (-0700) Subject: HGFS node cache from causing the VMX to go into an infinite loop X-Git-Tag: 2010.04.25-253928~37 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ed0813e340435e985d008b8136c7d6f2ec413126;p=thirdparty%2Fopen-vm-tools.git HGFS node cache from causing the VMX to go into an infinite loop If the HGFS server node cache becomes full and all the nodes are of the type that cannot be foreclosed and so cannot be removed the removal goes into an infinite loop. Fix it by only checking the number of entries in the list and then exiting with failure. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/lib/hgfsServer/hgfsServer.c b/open-vm-tools/lib/hgfsServer/hgfsServer.c index 3218c7029..989fb8e2a 100644 --- a/open-vm-tools/lib/hgfsServer/hgfsServer.c +++ b/open-vm-tools/lib/hgfsServer/hgfsServer.c @@ -4427,6 +4427,7 @@ HgfsRemoveLruNode(HgfsSessionInfo *session) // IN: session info HgfsFileNode *lruNode = NULL; HgfsHandle handle; Bool found = FALSE; + uint32 numOpenNodes = session->numCachedOpenNodes; ASSERT(session); ASSERT(session->numCachedOpenNodes > 0); @@ -4435,7 +4436,7 @@ HgfsRemoveLruNode(HgfsSessionInfo *session) // IN: session info * Remove the first item from the list that does not have a server lock, * file context or is open in sequential mode. */ - while (!found) { + while (!found && (numOpenNodes-- > 0)) { lruNode = DblLnkLst_Container(session->nodeCachedList.next, HgfsFileNode, links);