mirror of
https://github.com/hashcat/hashcat.git
synced 2025-02-09 14:13:07 +00:00
OSX didn't know about MAX_PATH, had to include limits.h; Use heap not stack memory
This commit is contained in:
parent
6d2aa559a6
commit
1550b9de07
@ -48,6 +48,7 @@
|
|||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <mach-o/dyld.h>
|
#include <mach-o/dyld.h>
|
||||||
#include <mach/mach.h>
|
#include <mach/mach.h>
|
||||||
|
#include <limits.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef void *OCL_LIB;
|
typedef void *OCL_LIB;
|
||||||
|
@ -15401,7 +15401,7 @@ int main (int argc, char **argv)
|
|||||||
|
|
||||||
snprintf (cpath, sizeof (cpath) - 1, "%s\\OpenCL\\", shared_dir);
|
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)
|
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);
|
snprintf (build_opts, sizeof (build_opts) - 1, "-I \"%s\"", cpath_real);
|
||||||
|
|
||||||
|
myfree (cpath_real);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
snprintf (cpath, sizeof (cpath) - 1, "%s/OpenCL/", shared_dir);
|
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)
|
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));
|
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
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user