summaryrefslogtreecommitdiff
path: root/modules/pam_unix/md5.c
diff options
context:
space:
mode:
authorTomas Mraz <tmraz@fedoraproject.org>2013-03-28 15:30:19 +0100
committerTomas Mraz <tmraz@fedoraproject.org>2013-03-28 15:30:19 +0100
commit183f91a212879229d37e4dce18edd7a141eefa12 (patch)
treeb0bd0a61bc6989b43550f7fb8bdd7f5edb08ca2e /modules/pam_unix/md5.c
parent9909a2b6ab99a32853224ae8dc0bb24c018d45e7 (diff)
Fix strict aliasing issue in MD5 implementations.
modules/pam_namespace/md5.c (MD5Final): Use memcpy instead of assignment. modules/pam_unix/md5.c (MD5Final): Use memcpy instead of assignment.
Diffstat (limited to 'modules/pam_unix/md5.c')
-rw-r--r--modules/pam_unix/md5.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/modules/pam_unix/md5.c b/modules/pam_unix/md5.c
index 7881db5d..94f0485b 100644
--- a/modules/pam_unix/md5.c
+++ b/modules/pam_unix/md5.c
@@ -142,8 +142,7 @@ void MD5Name(MD5Final)(unsigned char digest[16], struct MD5Context *ctx)
byteReverse(ctx->in, 14);
/* Append length in bits and transform */
- ((uint32 *) ctx->in)[14] = ctx->bits[0];
- ((uint32 *) ctx->in)[15] = ctx->bits[1];
+ memcpy((uint32 *)ctx->in + 14, ctx->bits, 2*sizeof(uint32));
MD5Name(MD5Transform)(ctx->buf, (uint32 *) ctx->in);
byteReverse((unsigned char *) ctx->buf, 4);