blob: 88f4f694c98046b27ee2459a3ac944dccc7c800e [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 -040017diff --git a/open-vm-tools/lib/misc/util_misc.c b/open-vm-tools/lib/misc/util_misc.c
Brad Bishop19323692019-04-05 15:28:33 -040018index 198c23d2..0ac0a335 100644
Brad Bishop15ae2502019-06-18 21:44:24 -040019--- a/open-vm-tools/lib/misc/util_misc.c
20+++ b/open-vm-tools/lib/misc/util_misc.c
Brad Bishop19323692019-04-05 15:28:33 -040021@@ -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);