diff options
author | Keuin <[email protected]> | 2022-05-29 01:17:03 +0800 |
---|---|---|
committer | Keuin <[email protected]> | 2022-05-29 02:30:36 +0800 |
commit | 86a701d3af323dcffe17b07e772e6be77c561dd8 (patch) | |
tree | 1d5ff422d7f8a46110bb42ebe1146575e677390d /main.c | |
parent | cddfe482b7067d0f1995d24b40e1c27e685d5b3e (diff) |
Bugfix: stack out-of-range access when printing non-terminated string with printf.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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; |