1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-23 23:19:09 +00:00

Restore: Add some checks on the rd->cwd variable in restore case

This commit is contained in:
jsteube 2017-02-14 20:05:44 +01:00
parent b2dbd22979
commit 4b3d39623c
2 changed files with 15 additions and 0 deletions

View File

@ -74,6 +74,7 @@
- OpenCL Kernel: Move kernel binary buffer from heap to stack memory - OpenCL Kernel: Move kernel binary buffer from heap to stack memory
- OpenCL Kernel: Refactored read_kernel_binary to load only a single kernel for a single device - OpenCL Kernel: Refactored read_kernel_binary to load only a single kernel for a single device
- Outfile Check: Fixed a memory leak for failed outfile reads - Outfile Check: Fixed a memory leak for failed outfile reads
- Restore: Add some checks on the rd->cwd variable in restore case
- Rule Engine: Fixed several memory leaks in case loading of rules failed - Rule Engine: Fixed several memory leaks in case loading of rules failed
- Session Management: Fixed several memory leaks in case profile- or install-folder setup failed - Session Management: Fixed several memory leaks in case profile- or install-folder setup failed
- OpenCL Header: Updated CL_* errorcode to OpenCL 1.2 standard - OpenCL Header: Updated CL_* errorcode to OpenCL 1.2 standard

View File

@ -97,6 +97,20 @@ static int read_restore (hashcat_ctx_t *hashcat_ctx)
fclose (fp); fclose (fp);
if (hc_path_exist (rd->cwd) == false)
{
event_log_error (hashcat_ctx, "%s: %s", rd->cwd, strerror (errno));
return -1;
}
if (hc_path_is_directory (rd->cwd) == false)
{
event_log_error (hashcat_ctx, "%s: %s", rd->cwd, strerror (errno));
return -1;
}
event_log_warning (hashcat_ctx, "Changing current working directory to '%s'", rd->cwd); event_log_warning (hashcat_ctx, "Changing current working directory to '%s'", rd->cwd);
event_log_warning (hashcat_ctx, NULL); event_log_warning (hashcat_ctx, NULL);