Skip to content
Snippets Groups Projects
Commit b68d63ce authored by Marek Vasut's avatar Marek Vasut Committed by Wolfgang Denk
Browse files

GCC47: Fix warning in md5.c


md5.c: In function ‘MD5Final’:
md5.c:156:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
md5.c:157:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

Signed-off-by: default avatarMarek Vasut <marex@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
Acked-by: default avatarMike Frysinger <vapier@gentoo.org>
parent f624dd15
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,10 @@ ...@@ -11,7 +11,10 @@
struct MD5Context { struct MD5Context {
__u32 buf[4]; __u32 buf[4];
__u32 bits[2]; __u32 bits[2];
unsigned char in[64]; union {
unsigned char in[64];
__u32 in32[16];
};
}; };
/* /*
......
...@@ -153,8 +153,8 @@ MD5Final(unsigned char digest[16], struct MD5Context *ctx) ...@@ -153,8 +153,8 @@ MD5Final(unsigned char digest[16], struct MD5Context *ctx)
byteReverse(ctx->in, 14); byteReverse(ctx->in, 14);
/* Append length in bits and transform */ /* Append length in bits and transform */
((__u32 *) ctx->in)[14] = ctx->bits[0]; ctx->in32[14] = ctx->bits[0];
((__u32 *) ctx->in)[15] = ctx->bits[1]; ctx->in32[15] = ctx->bits[1];
MD5Transform(ctx->buf, (__u32 *) ctx->in); MD5Transform(ctx->buf, (__u32 *) ctx->in);
byteReverse((unsigned char *) ctx->buf, 4); byteReverse((unsigned char *) ctx->buf, 4);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment