From 425290bf2b376f0549114b3b58215b26cea895c5 Mon Sep 17 00:00:00 2001 From: philsmd <philsmd@hashcat.net> Date: Fri, 17 Nov 2017 09:50:52 +0100 Subject: [PATCH] use hc_asprintf () for PR #1451 instead of snprintf () --- src/hashes.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/hashes.c b/src/hashes.c index 9891e2770..28e9d37de 100644 --- a/src/hashes.c +++ b/src/hashes.c @@ -1036,9 +1036,9 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx) if (parser_status < PARSER_GLOBAL_ZERO) { - char *tmp_line_buf = (char *) malloc (HCBUFSIZ_LARGE); + char *tmp_line_buf; - snprintf (tmp_line_buf, HCBUFSIZ_LARGE, "%s", line_buf); + hc_asprintf (&tmp_line_buf, "%s", line_buf); compress_terminal_line_length (tmp_line_buf, 38, 32); @@ -1058,9 +1058,9 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx) if (parser_status < PARSER_GLOBAL_ZERO) { - char *tmp_line_buf = (char *) malloc (HCBUFSIZ_LARGE); + char *tmp_line_buf; - snprintf (tmp_line_buf, HCBUFSIZ_LARGE, "%s", line_buf); + hc_asprintf (&tmp_line_buf, "%s", line_buf); compress_terminal_line_length (tmp_line_buf, 38, 32); @@ -1082,9 +1082,9 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx) if (parser_status < PARSER_GLOBAL_ZERO) { - char *tmp_line_buf = (char *) malloc (HCBUFSIZ_LARGE); + char *tmp_line_buf; - snprintf (tmp_line_buf, HCBUFSIZ_LARGE, "%s", line_buf); + hc_asprintf (&tmp_line_buf, "%s", line_buf); compress_terminal_line_length (tmp_line_buf, 38, 32); @@ -1107,9 +1107,9 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx) if (parser_status < PARSER_GLOBAL_ZERO) { - char *tmp_line_buf = (char *) malloc (HCBUFSIZ_LARGE); + char *tmp_line_buf; - snprintf (tmp_line_buf, HCBUFSIZ_LARGE, "%s", line_buf); + hc_asprintf (&tmp_line_buf, "%s", line_buf); compress_terminal_line_length (tmp_line_buf, 38, 32);