From: simon Date: Tue, 21 Dec 2010 10:11:32 +0000 (+0000) Subject: Protect against a (non-security-related) buffer overrun if PuTTY is X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/commitdiff_plain/ee2b7cd80f8868196f6e0e8bc2388cb4db1b729e Protect against a (non-security-related) buffer overrun if PuTTY is installed somewhere with an exceptionally long pathname. git-svn-id: svn://svn.tartarus.org/sgt/putty@9039 cda61777-01e9-0310-a592-d414129be87e --- 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;