From: Baptiste DURAND Date: Thu, 13 Jun 2013 17:07:00 +0000 (+0200) Subject: Fix build strict aliasing Error X-Git-Tag: submit/tizen/20130614.202621~3 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fsystem%2Fsync-agent.git;a=commitdiff_plain;h=0512d01db18f6d7dc1188a188b110fa335be4e7f Fix build strict aliasing Error To avoid error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] --- diff --git a/src/framework/security-assistant/md5.c b/src/framework/security-assistant/md5.c index 347fbfc..a999043 100755 --- a/src/framework/security-assistant/md5.c +++ b/src/framework/security-assistant/md5.c @@ -256,9 +256,8 @@ void sa_md5_final(sa_md5_context_s * ctx, unsigned char *digest) _byte_reverse(ctx->in, 14); /* Append length in bits and transform */ - ((unsigned int *)ctx->in)[14] = ctx->bits[0]; - ((unsigned int *)ctx->in)[15] = ctx->bits[1]; - + memcpy(&(ctx->in[56]),ctx->bits,sizeof(ctx->bits)); + _md5_transform(ctx->buf, (const long unsigned int *)ctx->in); if (ctx->doByteReverse) _byte_reverse((unsigned char *)ctx->buf, 4);