# HG changeset patch # User Matti Hamalainen # Date 1352278463 -7200 # Node ID bee1f36efc16a80f5df4cb40acaf4119b955b4b3 # Parent 0995fa2334621d391dd7e5f6af5fa2849b269886 Fix potential aliasing issues. diff -r 0995fa233462 -r bee1f36efc16 src/xs_support.c --- 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);