mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-26 01:32:25 +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:
parent
d31d1f4bb5
commit
094459a7e6
@ -2003,7 +2003,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
|
|||||||
{
|
{
|
||||||
char b[2048], *p, *q, *r;
|
char b[2048], *p, *q, *r;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
GetModuleFileName(NULL, b, sizeof(b) - 1);
|
GetModuleFileName(NULL, b, sizeof(b) - 16);
|
||||||
r = b;
|
r = b;
|
||||||
p = strrchr(b, '\\');
|
p = strrchr(b, '\\');
|
||||||
if (p && p >= r) r = p+1;
|
if (p && p >= r) r = p+1;
|
||||||
|
Loading…
Reference in New Issue
Block a user