Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-emulation/hercules/files: hercules-3.09-aliasing.patch
Date: Tue, 27 Aug 2013 16:30:03
Message-Id: 20130827162957.6B3392004C@flycatcher.gentoo.org
1 vapier 13/08/27 16:29:57
2
3 Added: hercules-3.09-aliasing.patch
4 Log:
5 Version bump.
6
7 (Portage version: 2.2.0/cvs/Linux x86_64, signed Manifest commit with key FB7C4156)
8
9 Revision Changes Path
10 1.1 app-emulation/hercules/files/hercules-3.09-aliasing.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/hercules/files/hercules-3.09-aliasing.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/hercules/files/hercules-3.09-aliasing.patch?rev=1.1&content-type=text/plain
14
15 Index: hercules-3.09-aliasing.patch
16 ===================================================================
17 From 7d3255a18ad845953cc8083371e8623e771ad4f5 Mon Sep 17 00:00:00 2001
18 From: Mike Frysinger <vapier@g.o>
19 Date: Tue, 27 Aug 2013 12:25:49 -0400
20 Subject: [PATCH] sha: fix strict aliasing warnings
21
22 sha256.c:492:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
23 sha256.c:784:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
24 sha256.c:785:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
25
26 Signed-off-by: Mike Frysinger <vapier@g.o>
27 ---
28 crypto/sha256.c | 6 +++---
29 1 file changed, 3 insertions(+), 3 deletions(-)
30
31 diff --git a/crypto/sha256.c b/crypto/sha256.c
32 index 1a6a243..b1e90b4 100644
33 --- a/crypto/sha256.c
34 +++ b/crypto/sha256.c
35 @@ -489,7 +489,7 @@ SHA256_Final(u_int8_t digest[], SHA256_CTX *context)
36 *context->buffer = 0x80;
37 }
38 /* Set the bit count: */
39 - *(u_int64_t *)&context->buffer[SHA256_SHORT_BLOCK_LENGTH] = context->bitcount;
40 + memcpy (&context->buffer[SHA256_SHORT_BLOCK_LENGTH], &context->bitcount, 8);
41
42 /* Final transform: */
43 SHA256_Transform(context, context->buffer);
44 @@ -781,8 +781,8 @@ SHA512_Last(SHA512_CTX *context)
45 *context->buffer = 0x80;
46 }
47 /* Store the length of input data (in bits): */
48 - *(u_int64_t *)&context->buffer[SHA512_SHORT_BLOCK_LENGTH] = context->bitcount[1];
49 - *(u_int64_t *)&context->buffer[SHA512_SHORT_BLOCK_LENGTH+8] = context->bitcount[0];
50 + memcpy (&context->buffer[SHA512_SHORT_BLOCK_LENGTH], &context->bitcount[1], 8);
51 + memcpy (&context->buffer[SHA512_SHORT_BLOCK_LENGTH+8], context->bitcount[0], 8);
52
53 /* Final transform: */
54 SHA512_Transform(context, context->buffer);
55 --
56 1.8.3.2