Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 1 | From cfc6839362bd96bf2f42954160f16a60bf1de377 Mon Sep 17 00:00:00 2001 |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Sat, 22 Dec 2018 19:59:02 -0800 |
| 4 | Subject: [PATCH] misc: Do not print NULL string into logs |
| 5 | |
| 6 | string format %s is getting a NULL pointer for 'expand' |
| 7 | parameter always since the check for chunks[i] == NULL will ensure that |
| 8 | its always null when the Log() API is called |
| 9 | |
| 10 | Upstream-Status: Submitted [https://github.com/vmware/open-vm-tools/pull/312] |
| 11 | |
| 12 | Signed-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 Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 17 | --- a/open-vm-tools/lib/misc/util_misc.c |
| 18 | +++ b/open-vm-tools/lib/misc/util_misc.c |
Brad Bishop | 2d39a06 | 2019-10-28 08:33:36 -0400 | [diff] [blame] | 19 | @@ -719,7 +719,7 @@ Util_ExpandString(const char *fileName) |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 20 | ASSERT(!freeChunk[i]); |
| 21 | chunks[i] = expand; |
| 22 | if (chunks[i] == NULL) { |
Brad Bishop | 2d39a06 | 2019-10-28 08:33:36 -0400 | [diff] [blame] | 23 | - Log("%s: Cannot allocate memory to expand $ in \"%s\".\n", |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 24 | + Log("%s: Cannot allocate memory to expand in \"%s\".\n", |
Brad Bishop | 2d39a06 | 2019-10-28 08:33:36 -0400 | [diff] [blame] | 25 | __FUNCTION__, fileName); |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 26 | goto out; |
| 27 | } |