From: John Wolfe Date: Mon, 5 Apr 2021 16:01:43 +0000 (-0700) Subject: Check return value from VmCheck_GetVersion. X-Git-Tag: stable-11.3.0~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b81140454253dfe3c836c03e221aa832da4ac9e8;p=thirdparty%2Fopen-vm-tools.git Check return value from VmCheck_GetVersion. Fixed an issue reported by Coverity scan of open-vm-tools. --- diff --git a/open-vm-tools/lib/vmCheck/vmcheck.c b/open-vm-tools/lib/vmCheck/vmcheck.c index 3277f0c4b..ca1482662 100644 --- a/open-vm-tools/lib/vmCheck/vmcheck.c +++ b/open-vm-tools/lib/vmCheck/vmcheck.c @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2006-2020 VMware, Inc. All rights reserved. + * Copyright (C) 2006-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -317,14 +317,20 @@ VmCheck_IsVirtualWorld(void) } /* It should be safe to use the backdoor without a crash handler now. */ - VmCheck_GetVersion(&version, &dummy); + if (!VmCheck_GetVersion(&version, &dummy)) { + Debug("%s: VmCheck_GetVersion failed.\n", __FUNCTION__); + return FALSE; + } #else /* * The Win32 vmwvaudio driver uses this function, so keep the old, * VMware-only check. */ __try { - VmCheck_GetVersion(&version, &dummy); + if (!VmCheck_GetVersion(&version, &dummy)) { + Debug("%s: VmCheck_GetVersion failed.\n", __FUNCTION__); + return FALSE; + } } __except (GetExceptionCode() == STATUS_PRIVILEGED_INSTRUCTION) { return FALSE; }