Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 395266 Details for
Bug 532088
dev-libs/lzo-2.08: remove
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for lzo-2.08 that fixes undefined behavior causing crashes on strictly aligned architectures.
lzo-2.08_alignment_fix.patch (text/plain), 3.61 KB, created by
David Mattli
on 2015-01-31 20:39:21 UTC
(
hide
)
Description:
Patch for lzo-2.08 that fixes undefined behavior causing crashes on strictly aligned architectures.
Filename:
MIME Type:
Creator:
David Mattli
Created:
2015-01-31 20:39:21 UTC
Size:
3.61 KB
patch
obsolete
>--- lzo-2.08/src/lzo_func.h 2014-06-29 04:38:49.000000000 -0500 >+++ lzo-2.08/src/lzo_func.h 2015-01-31 11:18:58.000000000 -0600 >@@ -384,7 +384,8 @@ > __lzo_static_forceinline lzo_uint16_t lzo_memops_get_ne16(const lzo_voidp ss) > { > lzo_uint16_t v; >- LZO_MEMOPS_COPY2(&v, ss); >+ const lzo_memops_TU1p s = (const lzo_memops_TU1p) ss; >+ v = (lzo_uint16_t) (((lzo_uint16_t)s[1]<<0) | ((lzo_uint16_t)s[0] << 8)); > return v; > } > #if (LZO_OPT_UNALIGNED16) >@@ -396,7 +397,8 @@ > __lzo_static_forceinline lzo_uint32_t lzo_memops_get_ne32(const lzo_voidp ss) > { > lzo_uint32_t v; >- LZO_MEMOPS_COPY4(&v, ss); >+ const lzo_memops_TU1p s = (const lzo_memops_TU1p) ss; >+ v = (lzo_uint32_t) (((lzo_uint32_t)s[3]) | ((lzo_uint32_t)s[2] << 8) | ((lzo_uint32_t)s[1] << 16) | ((lzo_uint32_t)s[0] << 24)); > return v; > } > #if (LZO_OPT_UNALIGNED32) >@@ -453,7 +455,9 @@ > > __lzo_static_forceinline void lzo_memops_put_ne16(lzo_voidp dd, lzo_uint16_t vv) > { >- LZO_MEMOPS_COPY2(dd, &vv); >+ lzo_memops_TU1p d = (lzo_memops_TU1p) dd; >+ d[1] = LZO_BYTE((vv ) & 0xff); >+ d[0] = LZO_BYTE((vv >> 8) & 0xff); > } > #if (LZO_OPT_UNALIGNED16) > #define LZO_MEMOPS_PUT_NE16(dd,vv) (* (lzo_memops_TU2p) (lzo_memops_TU0p) (dd) = (vv)) >@@ -463,7 +467,12 @@ > > __lzo_static_forceinline void lzo_memops_put_ne32(lzo_voidp dd, lzo_uint32_t vv) > { >- LZO_MEMOPS_COPY4(dd, &vv); >+ lzo_memops_TU1p d = (lzo_memops_TU1p) dd; >+ d[3] = LZO_BYTE((vv ) & 0xff); >+ d[2] = LZO_BYTE((vv >> 8) & 0xff); >+ d[1] = LZO_BYTE((vv >> 16) & 0xff); >+ d[0] = LZO_BYTE((vv >> 24) & 0xff); >+ > } > #if (LZO_OPT_UNALIGNED32) > #define LZO_MEMOPS_PUT_NE32(dd,vv) (* (lzo_memops_TU4p) (lzo_memops_TU0p) (dd) = (vv)) >--- lzo-2.08/minilzo/minilzo.c 2014-06-29 04:38:49.000000000 -0500 >+++ lzo-2.08/minilzo/minilzo.c 2015-01-31 11:06:06.000000000 -0600 >@@ -3573,9 +3573,10 @@ > > __lzo_static_forceinline lzo_uint16_t lzo_memops_get_ne16(const lzo_voidp ss) > { >- lzo_uint16_t v; >- LZO_MEMOPS_COPY2(&v, ss); >- return v; >+ lzo_uint16_t v; >+ const lzo_memops_TU1p s = (const lzo_memops_TU1p) ss; >+ v = (lzo_uint16_t) (((lzo_uint16_t)s[1]<<0) | ((lzo_uint16_t)s[0] << 8)); >+ return v; > } > #if (LZO_OPT_UNALIGNED16) > #define LZO_MEMOPS_GET_NE16(ss) * (const lzo_memops_TU2p) (const lzo_memops_TU0p) (ss) >@@ -3585,9 +3586,10 @@ > > __lzo_static_forceinline lzo_uint32_t lzo_memops_get_ne32(const lzo_voidp ss) > { >- lzo_uint32_t v; >- LZO_MEMOPS_COPY4(&v, ss); >- return v; >+ lzo_uint32_t v; >+ const lzo_memops_TU1p s = (const lzo_memops_TU1p) ss; >+ v = (lzo_uint32_t) (((lzo_uint32_t)s[3]) | ((lzo_uint32_t)s[2] << 8) | ((lzo_uint32_t)s[1] << 16) | ((lzo_uint32_t)s[0] << 24)); >+ return v; > } > #if (LZO_OPT_UNALIGNED32) > #define LZO_MEMOPS_GET_NE32(ss) * (const lzo_memops_TU4p) (const lzo_memops_TU0p) (ss) >@@ -3643,7 +3645,9 @@ > > __lzo_static_forceinline void lzo_memops_put_ne16(lzo_voidp dd, lzo_uint16_t vv) > { >- LZO_MEMOPS_COPY2(dd, &vv); >+ lzo_memops_TU1p d = (lzo_memops_TU1p) dd; >+ d[1] = LZO_BYTE((vv ) & 0xff); >+ d[0] = LZO_BYTE((vv >> 8) & 0xff); > } > #if (LZO_OPT_UNALIGNED16) > #define LZO_MEMOPS_PUT_NE16(dd,vv) (* (lzo_memops_TU2p) (lzo_memops_TU0p) (dd) = (vv)) >@@ -3653,7 +3657,11 @@ > > __lzo_static_forceinline void lzo_memops_put_ne32(lzo_voidp dd, lzo_uint32_t vv) > { >- LZO_MEMOPS_COPY4(dd, &vv); >+ lzo_memops_TU1p d = (lzo_memops_TU1p) dd; >+ d[3] = LZO_BYTE((vv ) & 0xff); >+ d[2] = LZO_BYTE((vv >> 8) & 0xff); >+ d[1] = LZO_BYTE((vv >> 16) & 0xff); >+ d[0] = LZO_BYTE((vv >> 24) & 0xff); > } > #if (LZO_OPT_UNALIGNED32) > #define LZO_MEMOPS_PUT_NE32(dd,vv) (* (lzo_memops_TU4p) (lzo_memops_TU0p) (dd) = (vv))
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 532088
: 395266