Mercurial > hg > xmms-sid
diff src/xs_support.c @ 792:bee1f36efc16
Fix potential aliasing issues.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 07 Nov 2012 10:54:23 +0200 |
parents | 91a36a4b79c6 |
children | 6b47d9813067 |
line wrap: on
line diff
--- a/src/xs_support.c Tue Nov 06 16:34:06 2012 +0200 +++ b/src/xs_support.c Wed Nov 07 10:54:23 2012 +0200 @@ -422,8 +422,8 @@ xs_md5_bytereverse(ctx->in, 14); /* Append length in bits and transform */ - ((guint32 *) ctx->in)[14] = ctx->bits[0]; - ((guint32 *) ctx->in)[15] = ctx->bits[1]; + memcpy(((guint32 *) ctx->in) + 14, &ctx->bits[0], sizeof(guint32)); + memcpy(((guint32 *) ctx->in) + 15, &ctx->bits[1], sizeof(guint32)); xs_md5_transform(ctx->buf, (guint32 *) ctx->in); xs_md5_bytereverse((guint8 *) ctx->buf, 4);