]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commit
Code cleanup to address a Coverity issue.
authorJohn Wolfe <jwolfe@vmware.com>
Wed, 19 Aug 2020 17:01:17 +0000 (10:01 -0700)
committerJohn Wolfe <jwolfe@vmware.com>
Wed, 19 Aug 2020 17:01:17 +0000 (10:01 -0700)
commitab85d3e86d4b44b9981eb5d652ce4fbe5ede4bbd
tree83cb446999cbafe3ff5321379ba6903eb335ff86
parent858534048c1036dfc8049e781f9cd6f989188b69
Code cleanup to address a Coverity issue.

Coverity reports a "dereference after NULL check" in
BkdoorChannelStart.  However, at the point of dereference
it's known that chan->inStarted is TRUE, which means chan->in
is guaranteed to be non-NULL, so it's not a bug.

Still, given that an input channel, if present, must have been
started before calling BkdoorChannelStart, it's possible to do
some code cleanup that will also get Coverity to stop reporting
the issue.  Change what's currently a test into an ASSERT, test
chan->in rather than chan->inStarted, and add comments to make
it clearer what's going on.
open-vm-tools/lib/rpcChannel/bdoorChannel.c