blob: 3e4753b2a63618a9b60d7ccde77d8e7f10af8cec [file] [log] [blame]
Brad Bishop15ae2502019-06-18 21:44:24 -04001From cfc6839362bd96bf2f42954160f16a60bf1de377 Mon Sep 17 00:00:00 2001
Brad Bishop19323692019-04-05 15:28:33 -04002From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 22 Dec 2018 19:59:02 -0800
4Subject: [PATCH] misc: Do not print NULL string into logs
5
6string format %s is getting a NULL pointer for 'expand'
7parameter always since the check for chunks[i] == NULL will ensure that
8its always null when the Log() API is called
9
10Upstream-Status: Submitted [https://github.com/vmware/open-vm-tools/pull/312]
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 open-vm-tools/lib/misc/util_misc.c | 4 ++--
15 1 file changed, 2 insertions(+), 2 deletions(-)
16
Brad Bishop15ae2502019-06-18 21:44:24 -040017--- a/open-vm-tools/lib/misc/util_misc.c
18+++ b/open-vm-tools/lib/misc/util_misc.c
Brad Bishop2d39a062019-10-28 08:33:36 -040019@@ -719,7 +719,7 @@ Util_ExpandString(const char *fileName)
Brad Bishop19323692019-04-05 15:28:33 -040020 ASSERT(!freeChunk[i]);
21 chunks[i] = expand;
22 if (chunks[i] == NULL) {
Brad Bishop2d39a062019-10-28 08:33:36 -040023- Log("%s: Cannot allocate memory to expand $ in \"%s\".\n",
Brad Bishop19323692019-04-05 15:28:33 -040024+ Log("%s: Cannot allocate memory to expand in \"%s\".\n",
Brad Bishop2d39a062019-10-28 08:33:36 -040025 __FUNCTION__, fileName);
Brad Bishop19323692019-04-05 15:28:33 -040026 goto out;
27 }