1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-03-05 09:36:05 +00:00

Do not create a kernel cache file if build failed. Also disregard any

existing cache files with size of zero. Should close #164.
This commit is contained in:
magnum 2016-01-27 13:30:38 +01:00
parent 9ec2c86cd0
commit f5d6f9b6d4
2 changed files with 8 additions and 5 deletions

View File

@ -13547,7 +13547,7 @@ int main (int argc, char **argv)
struct stat cst; struct stat cst;
if (stat (cached_file, &cst) == -1) if ((stat (cached_file, &cst) == -1) || cst.st_size == 0)
{ {
cached = 0; cached = 0;
} }

View File

@ -8672,12 +8672,15 @@ void load_kernel (const char *kernel_file, int num_devices, size_t *kernel_lengt
void writeProgramBin (char *dst, u8 *binary, size_t binary_size) void writeProgramBin (char *dst, u8 *binary, size_t binary_size)
{ {
if (binary_size > 0)
{
FILE *fp = fopen (dst, "wb"); FILE *fp = fopen (dst, "wb");
fwrite (binary, sizeof (u8), binary_size, fp); fwrite (binary, sizeof (u8), binary_size, fp);
fflush (fp); fflush (fp);
fclose (fp); fclose (fp);
}
} }
/** /**