return;
}
- char tmp_buf[1000];
+ char tmp_buf[1000] = { 0 };
uint tmp_len = 0;
{
wpa_t *wpa = (wpa_t *) data.esalts_buf;
- uint pke[25];
+ uint pke[25] = { 0 };
char *pke_ptr = (char *) pke;
pke[i] = byte_swap_32 (wpa->pke[i]);
}
- char mac1[6];
- char mac2[6];
+ char mac1[6] = { 0 };
+ char mac2[6] = { 0 };
memcpy (mac1, pke_ptr + 23, 6);
memcpy (mac2, pke_ptr + 29, 6);
}
else
{
- char out_buf[4096];
+ char out_buf[4096] = { 0 };
ascii_digest (out_buf, 0, 0);
{
if (data.hash_mode == 3000)
{
- char out_buf1[4096];
- char out_buf2[4096];
+ char out_buf1[4096] = { 0 };
+ char out_buf2[4096] = { 0 };
ascii_digest (out_buf1, 0, 0);
ascii_digest (out_buf2, 0, 1);
* speed new
*/
- u64 speed_cnt[DEVICES_MAX];
- float speed_ms[DEVICES_MAX];
+ u64 speed_cnt[DEVICES_MAX] = { 0 };
+ float speed_ms[DEVICES_MAX] = { 0 };
for (uint device_id = 0; device_id < data.devices_cnt; device_id++)
{
float hashes_all_ms = 0;
- float hashes_dev_ms[DEVICES_MAX];
+ float hashes_dev_ms[DEVICES_MAX] = { 0 };
for (uint device_id = 0; device_id < data.devices_cnt; device_id++)
{
if (sec_run)
{
- char display_run[32];
+ char display_run[32] = { 0 };
struct tm tm_run;
- struct tm *tmp;
+ struct tm *tmp = NULL;
#ifdef WIN
if (tmp != NULL)
{
- memcpy (&tm_run, tmp, sizeof (struct tm));
+ memset (&tm_run, 0, sizeof (tm_run));
+
+ memcpy (&tm_run, tmp, sizeof (tm_run));
format_timer_display (&tm_run, display_run, sizeof (tm_run));
}
else
{
- char display_etc[32];
+ char display_etc[32] = { 0 };
struct tm tm_etc;
- struct tm *tmp;
+ struct tm *tmp = NULL;
#ifdef WIN
if (tmp != NULL)
{
+ memset (&tm_etc, 0, sizeof (tm_etc));
+
memcpy (&tm_etc, tmp, sizeof (tm_etc));
format_timer_display (&tm_etc, display_etc, sizeof (display_etc));
if (data.hm_device[device_id].fan_supported == 1)
{
- char utilization[HM_STR_BUF_SIZE];
- char temperature[HM_STR_BUF_SIZE];
- char fanspeed[HM_STR_BUF_SIZE];
+ char utilization[HM_STR_BUF_SIZE] = { 0 };
+ char temperature[HM_STR_BUF_SIZE] = { 0 };
+ char fanspeed[HM_STR_BUF_SIZE] = { 0 };
hm_device_val_to_str ((char *) utilization, HM_STR_BUF_SIZE, "%", hm_get_utilization_with_device_id (device_id));
hm_device_val_to_str ((char *) temperature, HM_STR_BUF_SIZE, "c", hm_get_temperature_with_device_id (device_id));
}
else
{
- char utilization[HM_STR_BUF_SIZE];
- char temperature[HM_STR_BUF_SIZE];
+ char utilization[HM_STR_BUF_SIZE] = { 0 };
+ char temperature[HM_STR_BUF_SIZE] = { 0 };
hm_device_val_to_str ((char *) utilization, HM_STR_BUF_SIZE, "%", hm_get_utilization_with_device_id (device_id));
hm_device_val_to_str ((char *) temperature, HM_STR_BUF_SIZE, "c", hm_get_temperature_with_device_id (device_id));
if (data.words_cnt == 0) return;
- u64 speed_cnt[DEVICES_MAX];
- float speed_ms[DEVICES_MAX];
+ u64 speed_cnt[DEVICES_MAX] = { 0 };
+ float speed_ms[DEVICES_MAX] = { 0 };
for (uint device_id = 0; device_id < data.devices_cnt; device_id++)
{
float hashes_all_ms = 0;
- float hashes_dev_ms[DEVICES_MAX];
+ float hashes_dev_ms[DEVICES_MAX] = { 0 };
for (uint device_id = 0; device_id < data.devices_cnt; device_id++)
{
uint debug_mode = data.debug_mode;
char *debug_file = data.debug_file;
- char debug_rule_buf[BLOCK_SIZE];
+ char debug_rule_buf[BLOCK_SIZE] = { 0 };
int debug_rule_len = 0; // -1 error
uint debug_plain_len = 0;
- u8 debug_plain_ptr[BLOCK_SIZE];
+ u8 debug_plain_ptr[BLOCK_SIZE] = { 0 };
// hash
u64 crackpos = device_param->words_off;
- uint plain_buf[16];
+ uint plain_buf[16] = { 0 };
u8 *plain_ptr = (u8 *) plain_buf;
- unsigned int plain_len = 0;
+ unsigned int plain_len = 0;
if (data.attack_mode == ATTACK_MODE_STRAIGHT)
{
char *tmp = (char *) mymalloc (FILLSZ);
- memset (tmp, 0, FILLSZ);
-
for (uint i = 0; i < size; i += FILLSZ)
{
const int left = size - i;
if (data.attack_mode == ATTACK_MODE_COMBI)
{
- char line_buf[BUFSIZ];
+ char line_buf[BUFSIZ] = { 0 };
uint i = 0;
if (esalt_size) hash_buf.esalt = (void *) mymalloc (esalt_size);
- uint digest_buf[64];
+ uint digest_buf[64] = { 0 };
outfile_data_t *out_info = NULL;
while (!feof (fp))
{
- char line_buf[BUFSIZ];
-
- memset (line_buf, 0, BUFSIZ);
+ char line_buf[BUFSIZ] = { 0 };
char *ptr = fgets (line_buf, BUFSIZ - 1, fp);
wpa_t *wpas = (wpa_t *) data.esalts_buf;
wpa_t *wpa = &wpas[salt_pos];
- uint pke[25];
+ uint pke[25] = { 0 };
char *pke_ptr = (char *) pke;
pke[i] = byte_swap_32 (wpa->pke[i]);
}
- u8 mac1[6];
- u8 mac2[6];
+ u8 mac1[6] = { 0 };
+ u8 mac2[6] = { 0 };
memcpy (mac1, pke_ptr + 23, 6);
memcpy (mac2, pke_ptr + 29, 6);
while (words_cur < kernel_blocks)
{
- char buf[BUFSIZ];
+ char buf[BUFSIZ] = { 0 };
char *line_buf = fgets (buf, sizeof (buf), stdin);
while (!feof (fp))
{
- char line_buf[BUFSIZ];
+ char line_buf[BUFSIZ] = { 0 };
int line_len = fgetl (fp, line_buf);
if (compute)
{
- char display[100];
+ char display[100] = { 0 };
snprintf (display, sizeof (display) - 1, "DISPLAY=%s", compute);
uint dictstat_nmemb = 0;
#endif
- char dictstat[256];
+ char dictstat[256] = { 0 };
FILE *dictstat_fp = NULL;
if (keyspace == 0)
{
- memset (dictstat, 0, sizeof (dictstat));
-
snprintf (dictstat, sizeof (dictstat) - 1, "%s/hashcat.dictstat", profile_dir);
dictstat_fp = fopen (dictstat, "rb");
{
line_num++;
- char line_buf[BUFSIZ];
+ char line_buf[BUFSIZ] = { 0 };
int line_len = fgetl (pot_fp, line_buf);
log_info ("WARNING: Hash '%s': %s", input_buf, strparser (parser_status));
}
-
parser_status = parse_func (hash_buf + 16, 16, &hashes_buf[hashes_cnt]);
hash_t *lm_hash_right = NULL;
{
line_num++;
- char line_buf[BUFSIZ];
+ char line_buf[BUFSIZ] = { 0 };
int line_len = fgetl (fp, line_buf);
{
user_t **user = &hashes_buf[hashes_cnt].hash_info->user;
- *user = (user_t *) malloc (sizeof (user_t));
+ *user = (user_t *) mymalloc (sizeof (user_t));
user_t *user_ptr = *user;
{
while (!feof (fp))
{
- char line_buf[BUFSIZ];
-
- memset (line_buf, 0, BUFSIZ);
+ char line_buf[BUFSIZ] = { 0 };
char *ptr = fgets (line_buf, BUFSIZ - 1, fp);
// to be safe work with a copy (because of line_len loop, i etc)
- char line_buf_cpy[BUFSIZ];
- memset (line_buf_cpy, 0, BUFSIZ);
-
- memset (line_buf_cpy, 0, sizeof (line_buf_cpy));
+ char line_buf_cpy[BUFSIZ] = { 0 };
memcpy (line_buf_cpy, line_buf, i);
{
wpa_t *wpa = (wpa_t *) found->esalt;
- uint pke[25];
+ uint pke[25] = { 0 };
char *pke_ptr = (char *) pke;
pke[i] = byte_swap_32 (wpa->pke[i]);
}
- u8 mac1[6];
- u8 mac2[6];
+ u8 mac1[6] = { 0 };
+ u8 mac2[6] = { 0 };
memcpy (mac1, pke_ptr + 23, 6);
memcpy (mac2, pke_ptr + 29, 6);
all_kernel_rules_buf = (kernel_rule_t **) mycalloc (rp_files_cnt, sizeof (kernel_rule_t *));
}
- char rule_buf[BUFSIZ];
+ char rule_buf[BUFSIZ] = { 0 };
int rule_len = 0;
char *rp_file = rp_files[i];
- char in[BLOCK_SIZE];
- char out[BLOCK_SIZE];
+ char in[BLOCK_SIZE] = { 0 };
+ char out[BLOCK_SIZE] = { 0 };
FILE *fp = NULL;
* OpenCL platforms: detect
*/
- cl_platform_id platforms[CL_PLATFORMS_MAX];
+ cl_platform_id platforms[CL_PLATFORMS_MAX] = { 0 };
cl_uint platforms_cnt = 0;
- cl_device_id platform_devices[DEVICES_MAX];
+ cl_device_id platform_devices[DEVICES_MAX] = { 0 };
cl_uint platform_devices_cnt;
#if defined(WIN) && defined(HAVE_NVAPI)
if (NvAPI_Initialize () == NVAPI_OK)
{
- HM_ADAPTER_NV nvGPUHandle[DEVICES_MAX];
+ HM_ADAPTER_NV nvGPUHandle[DEVICES_MAX] = { 0 };
int tmp_in = hm_get_adapter_index_nv (nvGPUHandle);
{
if (hc_NVML_nvmlInit (hm_dll_nv) == NVML_SUCCESS)
{
- HM_ADAPTER_NV nvGPUHandle[DEVICES_MAX];
+ HM_ADAPTER_NV nvGPUHandle[DEVICES_MAX] = { 0 };
int tmp_in = hm_get_adapter_index_nv (nvGPUHandle);
{
char *build_log = (char *) mymalloc (ret_val_size + 1);
- memset (build_log, 0, ret_val_size + 1);
-
clGetProgramBuildInfo (device_param->program, device_param->device, CL_PROGRAM_BUILD_LOG, ret_val_size, build_log, NULL);
puts (build_log);
{
char *build_log = (char *) mymalloc (ret_val_size + 1);
- memset (build_log, 0, ret_val_size + 1);
-
clGetProgramBuildInfo (device_param->program_mp, device_param->device, CL_PROGRAM_BUILD_LOG, ret_val_size, build_log, NULL);
puts (build_log);
{
char *build_log = (char *) mymalloc (ret_val_size + 1);
- memset (build_log, 0, ret_val_size + 1);
-
clGetProgramBuildInfo (device_param->program_amp, device_param->device, CL_PROGRAM_BUILD_LOG, ret_val_size, build_log, NULL);
puts (build_log);
uint *result = (uint *) mymalloc (size_results);
- memset (result, 0, size_results);
-
device_param->result = result;
pw_t *pws_buf = (pw_t *) mymalloc (size_pws);
- memset (pws_buf, 0, size_pws);
-
device_param->pws_buf = pws_buf;
pw_cache_t *pw_caches = (pw_cache_t *) mycalloc (64, sizeof (pw_cache_t));
// find the bigger dictionary and use as base
- FILE *fp1;
- FILE *fp2;
+ FILE *fp1 = NULL;
+ FILE *fp2 = NULL;
struct stat tmp_stat;
return (-1);
}
- char line_buf[BUFSIZ];
+ char line_buf[BUFSIZ] = { 0 };
while (!feof (mask_fp))
{
return (-1);
}
- char line_buf[BUFSIZ];
+ char line_buf[BUFSIZ] = { 0 };
uint masks_avail = 1;
return (-1);
}
- char line_buf[BUFSIZ];
+ char line_buf[BUFSIZ] = { 0 };
uint masks_avail = 1;