]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Assertion after use fix - lib/file/standalone.c
authorOliver Kurth <okurth@vmware.com>
Mon, 28 Oct 2019 23:12:39 +0000 (16:12 -0700)
committerOliver Kurth <okurth@vmware.com>
Mon, 28 Oct 2019 23:12:39 +0000 (16:12 -0700)
One of the code scanners caught this one.

open-vm-tools/lib/file/fileStandAlone.c

index b7ce55e90cc748660ef2f3d274d8188df1d96895..df264124647c0ee44917432e6c34bdbc3d05248c 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 1998-2018 VMware, Inc. All rights reserved.
+ * Copyright (C) 1998-2019 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
@@ -202,13 +202,15 @@ File_SplitName(const char *pathName,  // IN:
    char *vol;
    char *dir;
    char *bas;
+   size_t len;
    char *baseBegin;
    char *volEnd;
    int volLen, dirLen;
-   int len = strlen(pathName);
 
    ASSERT(pathName != NULL);
 
+   len = strlen(pathName);
+
    /*
     * Get volume.
     */