]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Check return value from VmCheck_GetVersion.
authorJohn Wolfe <jwolfe@vmware.com>
Mon, 5 Apr 2021 16:01:43 +0000 (09:01 -0700)
committerJohn Wolfe <jwolfe@vmware.com>
Mon, 5 Apr 2021 16:01:43 +0000 (09:01 -0700)
Fixed an issue reported by Coverity scan of open-vm-tools.

open-vm-tools/lib/vmCheck/vmcheck.c

index 3277f0c4b58c95af50eaed5153e5591775200e72..ca148266267dbb5332931131379cc40331bfbb70 100644 (file)
@@ -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;
    }