]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Execute HGFS_ASSERT_INPUT only in successful code paths.
authorVMware, Inc <>
Thu, 22 Dec 2011 00:44:40 +0000 (16:44 -0800)
committerMarcelo Vanzin <mvanzin@vmware.com>
Thu, 22 Dec 2011 00:44:40 +0000 (16:44 -0800)
Check bug 816476 for more details. In changeset #1611812, we have
removed the special logic related to the default session. So, in case of
any error, HgfsParseRequest() doesn't guarantee that all the attributes of
HgfsInputParam datastructure will be filled. In case of an error, the
code should not execute HGFS_ASSERT_INPUT.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/hgfsServer/hgfsServer.c
open-vm-tools/lib/hgfsServer/hgfsServerParameters.c

index 0b0873ab44ac8f37d87c9fd5c588c9f85826ee6d..43b2c50e715cc485df71a0b01b995c1470651c38 100644 (file)
@@ -2924,7 +2924,11 @@ HgfsServerCompleteRequest(HgfsInternalStatus status,   // IN: Status of the requ
    size_t replyPacketSize;
    size_t replySize;
 
-   HGFS_ASSERT_INPUT(input);
+   if (HGFS_ERROR_SUCCESS == status) {
+      HGFS_ASSERT_INPUT(input);
+   } else {
+      ASSERT(input);
+   }
 
    if (input->v4header) {
       HgfsHeader *header;
index 546732afdc1529289176b200d6ea076ac73b4a5f..527be32d6cef660a3fb3f88e385ca4fb29bf62db 100644 (file)
@@ -308,7 +308,7 @@ HgfsParseRequest(HgfsPacket *packet,         // IN: request packet
          localInput->id = request->id;
       }
       ASSERT_DEVEL(0);
-      return HGFS_ERROR_PROTOCOL;
+      return FALSE;
    }
 
    if (request->op < HGFS_OP_OPEN_V3) {