]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Tiny patch from Martin Packman to fix a Windows handle leak in
authorSimon Tatham <anakin@pobox.com>
Mon, 28 Nov 2011 19:23:43 +0000 (19:23 +0000)
committerSimon Tatham <anakin@pobox.com>
Mon, 28 Nov 2011 19:23:43 +0000 (19:23 +0000)
Pageant's IPC mechanism. It's incomplete (he sent a much more
comprehensive set of fixes that I haven't reviewed), but should be
adequate to mitigate a particular issue for Bazaar users.

[originally from svn r9355]

windows/winpgnt.c

index e26621c7e4148d605d4f50cd915461e979970bbe..291593e49e4495a836a50e830e39642223c550a3 100644 (file)
@@ -1938,8 +1938,10 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
                     }
 #endif
                    if (!EqualSid(mapowner, ourself) &&
-                        !EqualSid(mapowner, ourself2))
+                        !EqualSid(mapowner, ourself2)) {
+                        CloseHandle(filemap);
                        return 0;      /* security ID mismatch! */
+                    }
 #ifdef DEBUG_IPC
                    debug(("security stuff matched\n"));
 #endif