Skip to content

Commit a0ca82c

Browse files
committed
issue #54: fixed memory issue with some unicode algorithms
1 parent 1154c34 commit a0ca82c

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

docs/changes.txt

+5
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ file.: Host
3535
desc.: Fixed the use of -s / -l parameters together with the attack mode -a 8 (Prince)
3636
issue: 40
3737

38+
type.: Bug
39+
file.: Host
40+
desc.: Fixed a memory issue with algorithms using unicode when trying password candidates longer than 27 characters
41+
issue: 54
42+
3843
type.: Bug
3944
file.: Host
4045
desc.: Fixed --help text for hash type -m 9900 = Radmin2 (was wronly displayed as -m 9800 = Radmin2)

src/engine.c

+8
Original file line numberDiff line numberDiff line change
@@ -4599,6 +4599,8 @@ void md4_final_sse2_max55 (plain_t *plains, digest_md4_sse2_t *digests)
45994599
{
46004600
plain_t *ptr = plains + i;
46014601

4602+
if (ptr.len >= 56) continue;
4603+
46024604
memset (ptr->buf8 + ptr->len, 0, 64 - ptr->len);
46034605

46044606
ptr->buf8[ptr->len] = 0x80;
@@ -4617,6 +4619,8 @@ void md5_final_sse2_max55 (plain_t *plains, digest_md5_sse2_t *digests)
46174619
{
46184620
plain_t *ptr = plains + i;
46194621

4622+
if (ptr->len >= 56) continue;
4623+
46204624
memset (ptr->buf8 + ptr->len, 0, 64 - ptr->len);
46214625

46224626
ptr->buf8[ptr->len] = 0x80;
@@ -4635,6 +4639,8 @@ void sha1_final_sse2_max55 (plain_t *plains, digest_sha1_sse2_t *digests)
46354639
{
46364640
plain_t *ptr = plains + i;
46374641

4642+
if (ptr->len >= 56) continue;
4643+
46384644
memset (ptr->buf8 + ptr->len, 0, 64 - ptr->len);
46394645

46404646
ptr->buf8[ptr->len] = 0x80;
@@ -4655,6 +4661,8 @@ void sha256_final_sse2_max55 (plain_t *plains, digest_sha256_sse2_t *digests)
46554661
{
46564662
plain_t *ptr = plains + i;
46574663

4664+
if (ptr->len >= 56) continue;
4665+
46584666
memset (ptr->buf8 + ptr->len, 0, 64 - ptr->len);
46594667

46604668
ptr->buf8[ptr->len] = 0x80;

0 commit comments

Comments
 (0)