summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2012-04-20 09:53:24 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2012-04-20 09:53:24 +0200
commit5149632eb5af0831a8728e8bb5d5c483d6e3f147 (patch)
tree17212422b57862650249948f4934e2227fce4b83
parent858fd39f6adea6353e9367759cf48ae2b439ffcc (diff)
* apt-pkg/contrib/sha2_internal.cc:
- do not use the input data directly but memcpy it instead as it could be unaligned as in the http-transport which causes a sigbus error on sparc (Closes: #669061)
-rw-r--r--apt-pkg/contrib/sha2_internal.cc8
-rw-r--r--debian/changelog6
2 files changed, 11 insertions, 3 deletions
diff --git a/apt-pkg/contrib/sha2_internal.cc b/apt-pkg/contrib/sha2_internal.cc
index 6d27e8f2b..83b5a98d3 100644
--- a/apt-pkg/contrib/sha2_internal.cc
+++ b/apt-pkg/contrib/sha2_internal.cc
@@ -552,7 +552,9 @@ void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) {
}
while (len >= SHA256_BLOCK_LENGTH) {
/* Process as many complete blocks as we can */
- SHA256_Transform(context, (sha2_word32*)data);
+ sha2_byte buffer[SHA256_BLOCK_LENGTH];
+ MEMCPY_BCOPY(buffer, data, SHA256_BLOCK_LENGTH);
+ SHA256_Transform(context, (sha2_word32*)buffer);
context->bitcount += SHA256_BLOCK_LENGTH << 3;
len -= SHA256_BLOCK_LENGTH;
data += SHA256_BLOCK_LENGTH;
@@ -879,7 +881,9 @@ void SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) {
}
while (len >= SHA512_BLOCK_LENGTH) {
/* Process as many complete blocks as we can */
- SHA512_Transform(context, (sha2_word64*)data);
+ sha2_byte buffer[SHA512_BLOCK_LENGTH];
+ MEMCPY_BCOPY(buffer, data, SHA512_BLOCK_LENGTH);
+ SHA512_Transform(context, (sha2_word64*)buffer);
ADDINC128(context->bitcount, SHA512_BLOCK_LENGTH << 3);
len -= SHA512_BLOCK_LENGTH;
data += SHA512_BLOCK_LENGTH;
diff --git a/debian/changelog b/debian/changelog
index c65c0249c..4d4d6a70e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,10 @@ apt (0.9.2) unstable; urgency=low
* apt-pkg/aptconfiguration.cc:
- if the compressor is not installed, but we link against it's
library accept it as a CompressionType (Closes: #669328)
+ * apt-pkg/contrib/sha2_internal.cc:
+ - do not use the input data directly but memcpy it instead as
+ it could be unaligned as in the http-transport which causes
+ a sigbus error on sparc (Closes: #669061)
[ Malcolm Scott ]
@@ -15,7 +19,7 @@ apt (0.9.2) unstable; urgency=low
- iterate over all pre-depends or-group member instead of looping
endlessly over the first member in SmartUnpack (LP: #985852)
- -- David Kalnischkies <kalnischkies@gmail.com> Fri, 20 Apr 2012 09:52:01 +0200
+ -- David Kalnischkies <kalnischkies@gmail.com> Fri, 20 Apr 2012 09:52:21 +0200
apt (0.9.1) unstable; urgency=low