From 531f72c9054f22838a884db8d5ef0cfd813ae8ed Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Tue, 23 Feb 2016 21:24:03 +0100 Subject: [PATCH] Fix this evil bug, pw->i is u32, not u8 --- src/oclHashcat.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/oclHashcat.c b/src/oclHashcat.c index 5ebb57f64..bcd8960e3 100644 --- a/src/oclHashcat.c +++ b/src/oclHashcat.c @@ -4302,9 +4302,11 @@ static void pw_add (hc_device_param_t *device_param, const u8 *pw_buf, const int { pw_t *pw = (pw_t *) device_param->pws_buf + device_param->pws_cnt; - memcpy (pw->i, pw_buf, pw_len); + u8 *ptr = (u8 *) pw->i; - memset (pw->i + pw_len, 0, sizeof (pw->i) - pw_len); + memcpy (ptr, pw_buf, pw_len); + + memset (ptr + pw_len, 0, sizeof (pw->i) - pw_len); pw->pw_len = pw_len;