1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-25 01:02:24 +00:00

Protect against a (non-security-related) buffer overrun if PuTTY is

installed somewhere with an exceptionally long pathname.

[originally from svn r9039]
This commit is contained in:
Simon Tatham 2010-12-21 10:11:32 +00:00
parent d31d1f4bb5
commit 094459a7e6

View File

@ -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;