From: VMware, Inc <> Date: Thu, 22 Dec 2011 00:44:40 +0000 (-0800) Subject: Execute HGFS_ASSERT_INPUT only in successful code paths. X-Git-Tag: 2011.12.20-562307~12 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=16dfce701317eab2c2aacac0705e34090807797c;p=thirdparty%2Fopen-vm-tools.git Execute HGFS_ASSERT_INPUT only in successful code paths. 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 --- diff --git a/open-vm-tools/lib/hgfsServer/hgfsServer.c b/open-vm-tools/lib/hgfsServer/hgfsServer.c index 0b0873ab4..43b2c50e7 100644 --- a/open-vm-tools/lib/hgfsServer/hgfsServer.c +++ b/open-vm-tools/lib/hgfsServer/hgfsServer.c @@ -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; diff --git a/open-vm-tools/lib/hgfsServer/hgfsServerParameters.c b/open-vm-tools/lib/hgfsServer/hgfsServerParameters.c index 546732afd..527be32d6 100644 --- a/open-vm-tools/lib/hgfsServer/hgfsServerParameters.c +++ b/open-vm-tools/lib/hgfsServer/hgfsServerParameters.c @@ -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) {