]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Fixing obsolete HGFS protocol support
authorVMware, Inc <>
Mon, 20 Sep 2010 17:50:01 +0000 (10:50 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Mon, 20 Sep 2010 17:50:01 +0000 (10:50 -0700)
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 <mvanzin@vmware.com>
open-vm-tools/lib/hgfsServer/hgfsServer.c

index 4b52c74ed8ce9671d2a529427393e9ba67552382..4b955b384f831944436d9536112c4b8eed7447c8 100644 (file)
@@ -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;
       }