Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 429956 Details for
Bug 579388
sys-devel/prelink-20151030: fix crash (segmentation fault) etc
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
prelink-20151030-libiberty-sha.patch
prelink-20151030-libiberty-sha.patch (text/plain), 1.23 KB, created by
Alexander Miller
on 2016-04-08 23:02:36 UTC
(
hide
)
Description:
prelink-20151030-libiberty-sha.patch
Filename:
MIME Type:
Creator:
Alexander Miller
Created:
2016-04-08 23:02:36 UTC
Size:
1.23 KB
patch
obsolete
>--- a/src/sha.c >+++ b/src/sha.c >@@ -78,6 +78,7 @@ sha_finish_ctx (struct sha_ctx *ctx, voi > { > /* Take yet unprocessed bytes into account. */ > md5_uint32 bytes = ctx->buflen; >+ md5_uint32 notswap_bytes; > size_t pad; > > /* Now count remaining bytes. */ >@@ -88,10 +89,13 @@ sha_finish_ctx (struct sha_ctx *ctx, voi > pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes; > memcpy (&ctx->buffer[bytes], fillbuf, pad); > >- /* Put the 64-bit file length in *bits* at the end of the buffer. */ >- *(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = NOTSWAP (ctx->total[0] << 3); >- *(md5_uint32 *) &ctx->buffer[bytes + pad] = NOTSWAP ((ctx->total[1] << 3) | >- (ctx->total[0] >> 29)); >+ /* Put the 64-bit file length in *bits* at the end of the buffer. >+ Use memcpy to avoid aliasing problems. On most systems, this >+ will be optimized away to the same code. */ >+ notswap_bytes = NOTSWAP (ctx->total[0] << 3); >+ memcpy (&ctx->buffer[bytes + pad + 4], notswap_bytes, sizeof (notswap_bytes)); >+ notswap_bytes = NOTSWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29)); >+ memcpy (&ctx->buffer[bytes + pad], notswap_bytes, sizeof (notswap_bytes)); > > /* Process last bytes. */ > sha_process_block (ctx->buffer, bytes + pad + 8, ctx);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 579388
:
429954
|
429956
|
429958
|
433408
|
490764