From: John Kohl Date: Thu, 17 Jan 1991 11:39:34 +0000 (+0000) Subject: fix problem with referencing past end of array on byte-aligned X-Git-Tag: krb5-1.0-alpha4~338 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=51346dec2af8ed67c4fa31ad4539720007d448c3;p=krb5.git fix problem with referencing past end of array on byte-aligned input git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1634 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/crypto/md4/md4.c b/src/lib/crypto/md4/md4.c index a1a397d84..038f2d52f 100644 --- a/src/lib/crypto/md4/md4.c +++ b/src/lib/crypto/md4/md4.c @@ -8,11 +8,15 @@ * md4.c from RFC1186 * * $Log$ - * Revision 5.1 1990/11/08 11:32:24 jtkohl + * Revision 5.2 1991/01/17 11:39:34 jtkohl + * fix problem with referencing past end of array on byte-aligned + * input + * + * Revision 5.1 90/11/08 11:32:24 jtkohl * change to copy onto stack to avoid modifying input in MDupdate * add Kerberos byte-order detection * some compilers will require the "L" qualifier on long constants. - * + * * Revision 5.0 90/11/07 14:12:04 jtkohl * Initial code from RFC * @@ -270,7 +274,7 @@ unsigned int count; p = MDp->count; while (tmp) { tmp += *p; - *p++ = tmp; + *p++ = (unsigned char) tmp; tmp = tmp >> 8; } /* Process data */ @@ -288,7 +292,11 @@ unsigned int count; byte = count >> 3; bit = count & 7; /* Copy X into XX since we need to modify it */ - for (i=0;i<=byte;i++) XX[i] = X[i]; + for (i=0;i