]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Initialise 'psa' to NULL on every code path in the Pageant client
authorSimon Tatham <anakin@pobox.com>
Sun, 21 Jul 2013 11:01:22 +0000 (11:01 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 21 Jul 2013 11:01:22 +0000 (11:01 +0000)
code, fixing a potential segfault when compiling with -DNO_SECURITY.

[originally from svn r9954]

windows/winpgntc.c

index de2b7009d162b2a0c2e093ab9fe81d28ff8d6119..4074a1653df48578c7f207476f32f79886123dc7 100644 (file)
@@ -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);