summaryrefslogtreecommitdiff
path: root/main/md5.c
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2012-04-28 01:33:49 +0000
committerRussell Bryant <russell@russellbryant.com>2012-04-28 01:33:49 +0000
commit19097a4b62860092f1dc70a42f07103c0586aed1 (patch)
treeedabfdda01aa76955b1406b7f9fdf9dfc1ab9017 /main/md5.c
parenteebdf3515952ec163c4009b26f1f0bad4590c390 (diff)
md5: supress some compiler warnings.
md5.c: In function ‘MD5Final’: md5.c:154:2: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] md5.c:155:2: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] There is an md5 unit test and it still passes. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@364462 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/md5.c')
-rw-r--r--main/md5.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/main/md5.c b/main/md5.c
index 849a26553..5e79729b5 100644
--- a/main/md5.c
+++ b/main/md5.c
@@ -123,6 +123,7 @@ void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
{
unsigned count;
unsigned char *p;
+ uint32_t *in_buf;
/* Compute number of bytes mod 64 */
count = (ctx->bits[0] >> 3) & 0x3F;
@@ -151,8 +152,9 @@ void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
byteReverse(ctx->in, 14);
/* Append length in bits and transform */
- ((uint32_t *) ctx->in)[14] = ctx->bits[0];
- ((uint32_t *) ctx->in)[15] = ctx->bits[1];
+ in_buf = (uint32_t *) ctx->in;
+ in_buf[14] = ctx->bits[0];
+ in_buf[15] = ctx->bits[1];
MD5Transform(ctx->buf, (uint32_t *) ctx->in);
byteReverse((unsigned char *) ctx->buf, 4);