diff options
author | Mike Gilbert <floppym@gentoo.org> | 2017-12-30 17:45:38 -0500 |
---|---|---|
committer | Mike Gilbert <floppym@gentoo.org> | 2017-12-30 17:46:03 -0500 |
commit | 521efc21ffc6e32dd4b14c15f3386d837817610d (patch) | |
tree | 965c7d352508478bd575a31125c7879a7dcb12f7 /media-gfx/fontforge | |
parent | sys-libs/libomp: Disallow kernels with PDU scheduler (diff) | |
download | gentoo-521efc21ffc6e32dd4b14c15f3386d837817610d.tar.gz gentoo-521efc21ffc6e32dd4b14c15f3386d837817610d.tar.bz2 gentoo-521efc21ffc6e32dd4b14c15f3386d837817610d.zip |
media-gfx/fontforge: fix misaligned memory access
Patch by Rolf Eike Beer.
Closes: https://bugs.gentoo.org/642756
Package-Manager: Portage-2.3.19_p3, Repoman-2.3.6_p37
Diffstat (limited to 'media-gfx/fontforge')
-rw-r--r-- | media-gfx/fontforge/files/20170731-gethex-unaligned.patch | 22 | ||||
-rw-r--r-- | media-gfx/fontforge/fontforge-20170731-r3.ebuild (renamed from media-gfx/fontforge/fontforge-20170731-r2.ebuild) | 1 |
2 files changed, 23 insertions, 0 deletions
diff --git a/media-gfx/fontforge/files/20170731-gethex-unaligned.patch b/media-gfx/fontforge/files/20170731-gethex-unaligned.patch new file mode 100644 index 000000000000..812f7a444721 --- /dev/null +++ b/media-gfx/fontforge/files/20170731-gethex-unaligned.patch @@ -0,0 +1,22 @@ +fix unaligned access in gethex() + +--- a/fontforge/sfd.c ++++ b/fontforge/sfd.c +@@ -3393,6 +3393,7 @@ + static int gethex(FILE *sfd, uint32 *val) { + char tokbuf[100]; int ch; + char *pt=tokbuf, *end = tokbuf+100-2; ++ uint32 u; + + while ( isspace(ch = nlgetc(sfd))); + if ( ch=='#' ) +@@ -3416,7 +3417,8 @@ + } + *pt='\0'; + ungetc(ch,sfd); +- *val = strtoul(tokbuf,NULL,16); ++ u = strtoul(tokbuf,NULL,16); ++ memcpy(val, &u, sizeof(u)); + return( pt!=tokbuf?1:ch==EOF?-1: 0 ); + } + diff --git a/media-gfx/fontforge/fontforge-20170731-r2.ebuild b/media-gfx/fontforge/fontforge-20170731-r3.ebuild index c8ad245b14d7..ae146eb06471 100644 --- a/media-gfx/fontforge/fontforge-20170731-r2.ebuild +++ b/media-gfx/fontforge/fontforge-20170731-r3.ebuild @@ -65,6 +65,7 @@ S="${WORKDIR}/fontforge-2.0.${PV}" PATCHES=( "${FILESDIR}"/20170731-startnoui-FindOrMakeEncoding.patch "${FILESDIR}"/20170731-tilepath.patch + "${FILESDIR}"/20170731-gethex-unaligned.patch ) pkg_setup() { |