From: Jens Steube Date: Fri, 24 Jun 2016 19:40:11 +0000 (+0200) Subject: OSX didn't know about MAX_PATH, had to include limits.h; Use heap not stack memory X-Git-Tag: v3.00~24 X-Git-Url: https://www.flypig.org.uk/git/?p=hashcat.git;a=commitdiff_plain;h=1550b9de0790ebf4c988b3871a3fa32ccb26bad7 OSX didn't know about MAX_PATH, had to include limits.h; Use heap not stack memory --- diff --git a/include/common.h b/include/common.h index b6e2a75..7bdef11 100644 --- a/include/common.h +++ b/include/common.h @@ -48,6 +48,7 @@ #include #include #include +#include #endif typedef void *OCL_LIB; diff --git a/src/hashcat.c b/src/hashcat.c index a9d9bb3..bc2724e 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -15401,7 +15401,7 @@ int main (int argc, char **argv) snprintf (cpath, sizeof (cpath) - 1, "%s\\OpenCL\\", shared_dir); - char cpath_real[MAX_PATH] = { 0 }; + char *cpath_real = mymalloc (MAX_PATH); if (GetFullPathName (cpath, MAX_PATH, cpath_real, NULL) == 0) { @@ -15412,11 +15412,13 @@ int main (int argc, char **argv) snprintf (build_opts, sizeof (build_opts) - 1, "-I \"%s\"", cpath_real); + myfree (cpath_real); + #else snprintf (cpath, sizeof (cpath) - 1, "%s/OpenCL/", shared_dir); - char cpath_real[PATH_MAX] = { 0 }; + char *cpath_real = mymalloc (PATH_MAX); if (realpath (cpath, cpath_real) == NULL) { @@ -15429,7 +15431,9 @@ int main (int argc, char **argv) naive_escape (cpath_real, cpath_escaped, sizeof (cpath_escaped)); - snprintf (build_opts, sizeof (build_opts) - 1, "-I %s", cpath_real); + myfree (cpath_real); + + snprintf (build_opts, sizeof (build_opts) - 1, "-I %s", cpath_escaped); #endif