blob: 7af265a999d1feece5f91983b192a09f5e3b4ccf [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001From e25d00d8297cba044c3a4d2e38749e54adac66c1 Mon Sep 17 00:00:00 2001
2From: 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
17diff --git open-vm-tools/lib/misc/util_misc.c b/open-vm-tools/lib/misc/util_misc.c
18index 198c23d2..0ac0a335 100644
19--- open-vm-tools/lib/misc/util_misc.c
20+++ open-vm-tools/lib/misc/util_misc.c
21@@ -719,8 +719,8 @@ Util_ExpandString(const char *fileName) // IN file path to expand
22 ASSERT(!freeChunk[i]);
23 chunks[i] = expand;
24 if (chunks[i] == NULL) {
25- Log("%s: Cannot allocate memory to expand \"%s\" in \"%s\".\n",
26- __FUNCTION__, expand, fileName);
27+ Log("%s: Cannot allocate memory to expand in \"%s\".\n",
28+ __FUNCTION__, fileName);
29 goto out;
30 }
31 chunkSize[i] = strlen(expand);