From: VMware, Inc <> Date: Mon, 20 Sep 2010 17:50:01 +0000 (-0700) Subject: Fixing obsolete HGFS protocol support X-Git-Tag: stable-8.6.0~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1895e6f6c1fba2f2fd984830b07ddc84a2e325b;p=thirdparty%2Fopen-vm-tools.git Fixing obsolete HGFS protocol support Payload size must be at least siZeof HgfsReply. HgfsServer returns payload size 0 on error for obsolete HGFS versions. Fixing to return at least header size. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/lib/hgfsServer/hgfsServer.c b/open-vm-tools/lib/hgfsServer/hgfsServer.c index 4b52c74ed..4b955b384 100644 --- a/open-vm-tools/lib/hgfsServer/hgfsServer.c +++ b/open-vm-tools/lib/hgfsServer/hgfsServer.c @@ -2720,7 +2720,7 @@ HgfsServerCompleteRequest(HgfsInternalStatus status, // IN: Status of the requ * Starting from HGFS V3 header is not included in the payload size. */ if (input->op < HGFS_OP_OPEN_V3) { - replySize = replyPayloadSize; + replySize = MAX(replyPayloadSize, sizeof *reply); } else { replySize = sizeof *reply + replyPayloadSize; }