]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Protect against a (non-security-related) buffer overrun if PuTTY is
authorSimon Tatham <anakin@pobox.com>
Tue, 21 Dec 2010 10:11:32 +0000 (10:11 +0000)
committerSimon Tatham <anakin@pobox.com>
Tue, 21 Dec 2010 10:11:32 +0000 (10:11 +0000)
installed somewhere with an exceptionally long pathname.

[originally from svn r9039]

windows/winpgnt.c

index d592a5e690ab6606f2b6244ef26709f60b44c4f3..3451fecabbd279213fc83ef188e15d011b9da731 100644 (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;