summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeuin <[email protected]>2022-05-29 01:17:03 +0800
committerKeuin <[email protected]>2022-05-29 02:30:36 +0800
commit86a701d3af323dcffe17b07e772e6be77c561dd8 (patch)
tree1d5ff422d7f8a46110bb42ebe1146575e677390d
parentcddfe482b7067d0f1995d24b40e1c27e685d5b3e (diff)
Bugfix: stack out-of-range access when printing non-terminated string with printf.
-rw-r--r--main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/main.c b/main.c
index 0f8d294..b6aa680 100644
--- a/main.c
+++ b/main.c
@@ -245,7 +245,9 @@ int thread_worker(thread_param *param) {
* So we mask out the LSBs from md5_hex before comparing */
if (ctx.yield == ((*(uint64_t *) md5_hex) & 0xFEFEFEFEFEFEFEFEull)) {
atomic_store(&key_found, true);
- printf("[+] FOUND KEY: %s\n", md5_hex);
+ printf("[+] FOUND KEY: ");
+ fwrite(md5_hex, 1, sizeof(md5_hex), stdout);
+ putchar('\n');
crack_result.plaintext = plaintext;
crack_result.len = unpadded_length;
return 0;