1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-29 02:49:01 +00:00

Fix an array bound passed to GetModuleFileName. It should be the size of

our static buffer, not 1024.
This commit is contained in:
david
2009-08-24 20:57:32 +00:00
parent 41d053a1ed
commit d6ea9ea18a

View File

@@ -2842,7 +2842,7 @@ int nmap_fetchfile(char *filename_returned, int bufferlen, const char *file) {
if (!foundsomething) { /* Try the nMap directory */
char fnbuf[MAX_PATH];
int i;
res = GetModuleFileName(GetModuleHandle(0), fnbuf, 1024);
res = GetModuleFileName(GetModuleHandle(0), fnbuf, sizeof(fnbuf));
if(!res) fatal("GetModuleFileName failed (!)\n");
/* Strip it */
for(i = res - 1; i >= 0 && fnbuf[i] != '/' && fnbuf[i] != '\\'; i--);