From: Simon Tatham Date: Tue, 21 Dec 2010 10:11:32 +0000 (+0000) Subject: Protect against a (non-security-related) buffer overrun if PuTTY is X-Git-Tag: 0.61~58 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=094459a7e69a5df0c426b001475863cb1c933cf2;p=PuTTY.git Protect against a (non-security-related) buffer overrun if PuTTY is installed somewhere with an exceptionally long pathname. [originally from svn r9039] --- diff --git a/windows/winpgnt.c b/windows/winpgnt.c index d592a5e6..3451feca 100644 --- a/windows/winpgnt.c +++ b/windows/winpgnt.c @@ -2003,7 +2003,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) { char b[2048], *p, *q, *r; FILE *fp; - GetModuleFileName(NULL, b, sizeof(b) - 1); + GetModuleFileName(NULL, b, sizeof(b) - 16); r = b; p = strrchr(b, '\\'); if (p && p >= r) r = p+1;