From 8f1aeeed9d446714594e2982d22e55a50f30e17d Mon Sep 17 00:00:00 2001 From: philsmd Date: Sun, 4 Oct 2020 09:59:24 +0200 Subject: [PATCH] Fixes a buffer problem in -m 23900 if pw_len is larger than expected --- OpenCL/m23900-pure.cl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenCL/m23900-pure.cl b/OpenCL/m23900-pure.cl index 3d203779d..7d2c6616f 100644 --- a/OpenCL/m23900-pure.cl +++ b/OpenCL/m23900-pure.cl @@ -35,7 +35,7 @@ KERNEL_FQ void m23900_init (KERN_ATTR_TMPS_ESALT (bestcrypt_tmp_t, bestcrypt_t)) if (gid >= gid_max) return; - const int salt_pw_len = 8 + pws[gid].pw_len; + const int salt_pw_len = 8 + MIN (pws[gid].pw_len, 56); u32 comb[16]; @@ -109,7 +109,7 @@ KERNEL_FQ void m23900_loop (KERN_ATTR_TMPS_ESALT (bestcrypt_tmp_t, bestcrypt_t)) if (gid >= gid_max) return; - const int salt_pw_len = 8 + pws[gid].pw_len; + const int salt_pw_len = 8 + MIN (pws[gid].pw_len, 56); u32 salt_pw_buf[32 + 1]; // 8 + 56 + 64 = 128 bytes