From: Kruti Date: Fri, 3 May 2024 16:05:45 +0000 (-0700) Subject: Fix the Y2K38_SAFETY finding found by Coverity scan. X-Git-Tag: stable-12.5.0~85 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12f3303f0559e74724b0656d192d32bd54957350;p=thirdparty%2Fopen-vm-tools.git Fix the Y2K38_SAFETY finding found by Coverity scan. Change the date type to 'long long' to make the size be 64 bits, same as that of time_t. --- diff --git a/open-vm-tools/libDeployPkg/linuxDeployment.c b/open-vm-tools/libDeployPkg/linuxDeployment.c index 4ddf3477a..d31d52927 100644 --- a/open-vm-tools/libDeployPkg/linuxDeployment.c +++ b/open-vm-tools/libDeployPkg/linuxDeployment.c @@ -1,5 +1,6 @@ /********************************************************* - * Copyright (c) 2006-2023 VMware, Inc. All rights reserved. + * Copyright (c) 2006-2024 Broadcom. All rights reserved. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. * * 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 @@ -1758,7 +1759,7 @@ ExtractZipPackage(const char* pkgName, Bool ret = TRUE; // strip the header from the file - snprintf(zipName, sizeof zipName, "%s/%x", destDir, (unsigned int)time(0)); + snprintf(zipName, sizeof zipName, "%s/%llx", destDir, (long long)time(NULL)); zipName[(sizeof zipName) - 1] = '\0'; if ((pkgFd = open(pkgName, O_RDONLY)) < 0) { sLog(log_error, "Failed to open package file '%s' for read. (%s)",