From 1e4e00c2d5ddbfb7e73f600a0002e74e4f2f6390 Mon Sep 17 00:00:00 2001 From: simon Date: Sun, 14 Jul 2013 10:46:17 +0000 Subject: [PATCH] Add a missing null pointer check in wc_unescape, to bring it in line with the usage comment saying you're allowed to pass NULL to find out only the return value. No caller actually does pass NULL at the moment. git-svn-id: svn://svn.tartarus.org/sgt/putty@9920 cda61777-01e9-0310-a592-d414129be87e --- wildcard.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wildcard.c b/wildcard.c index ae8bad80..c1cb0b49 100644 --- a/wildcard.c +++ b/wildcard.c @@ -326,7 +326,8 @@ int wc_unescape(char *output, const char *wildcard) wildcard++; } } - *output = '\0'; + if (output) + *output = '\0'; return 1; /* it's clean */ } -- 2.11.0