From 88ea89339783ee587180b645981967f6cb8bcd20 Mon Sep 17 00:00:00 2001 From: simon Date: Sun, 21 Jul 2013 11:01:22 +0000 Subject: [PATCH] Initialise 'psa' to NULL on every code path in the Pageant client code, fixing a potential segfault when compiling with -DNO_SECURITY. git-svn-id: svn://svn.tartarus.org/sgt/putty@9954 cda61777-01e9-0310-a592-d414129be87e --- windows/winpgntc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows/winpgntc.c b/windows/winpgntc.c index de2b7009..4074a165 100644 --- a/windows/winpgntc.c +++ b/windows/winpgntc.c @@ -173,6 +173,7 @@ int agent_query(void *in, int inlen, void **out, int *outlen, return 1; /* *out == NULL, so failure */ mapname = dupprintf("PageantRequest%08x", (unsigned)GetCurrentThreadId()); + psa = NULL; #ifndef NO_SECURITY if (advapi_initialised || init_advapi()) { /* @@ -186,7 +187,6 @@ int agent_query(void *in, int inlen, void **out, int *outlen, */ usersid = get_user_sid(); - psa = NULL; if (usersid) { psd = (PSECURITY_DESCRIPTOR) LocalAlloc(LPTR, SECURITY_DESCRIPTOR_MIN_LENGTH); -- 2.11.0