Merge pull request #107117 from TredwellGit/xorg.fonttosfnt

xorg.fonttosfnt: 1.0.5 -> 1.2.1
This commit is contained in:
Michele Guerini Rocco 2021-01-05 09:40:37 +01:00 committed by GitHub
commit 5748022aa3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 70 deletions

View file

@ -532,11 +532,11 @@ lib.makeScope newScope (self: with self; {
}) {};
fonttosfnt = callPackage ({ stdenv, pkgconfig, fetchurl, libfontenc, freetype, xorgproto }: stdenv.mkDerivation {
name = "fonttosfnt-1.0.5";
name = "fonttosfnt-1.2.1";
builder = ./builder.sh;
src = fetchurl {
url = "mirror://xorg/individual/app/fonttosfnt-1.0.5.tar.bz2";
sha256 = "00w5in1gznai141wishz8ng7spvi5274n16zj0pdl1ma2vsmy2n8";
url = "mirror://xorg/individual/app/fonttosfnt-1.2.1.tar.bz2";
sha256 = "16r51h5wfy85wnbq3q8v8a184hb25c3ksjgix0mlcywdz7qkbj07";
};
hardeningDisable = [ "bindnow" "relro" ];
nativeBuildInputs = [ pkgconfig ];

View file

@ -1,61 +0,0 @@
From 51e8117654fb092ae5412d7aa184bfc6b498c954 Mon Sep 17 00:00:00 2001
From: rnhmjoj <rnhmjoj@inventati.org>
Date: Fri, 7 Feb 2020 17:46:54 +0100
Subject: [PATCH 1/2] Fix incorrect error handling in macTime()
mktime() and time() return (time_t -1) to signal an error.
Checking for negative values will incorrectly assume an error
happened for any calendar date before the unix epoch.
---
util.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/util.c b/util.c
index bcbfa2f..4482c9a 100644
--- a/util.c
+++ b/util.c
@@ -213,10 +213,10 @@ macTime(int *hi, unsigned *lo)
tm.tm_isdst = -1;
macEpoch = mktime_gmt(&tm);
- if(macEpoch < 0) return -1;
+ if(macEpoch == -1) return -1;
current = time(NULL);
- if(current < 0)
+ if(current == -1)
return -1;
if(current < macEpoch) {
--
2.23.0
From 81a61c049e6de80120531f0770b22e7637c9acb9 Mon Sep 17 00:00:00 2001
From: rnhmjoj <rnhmjoj@inventati.org>
Date: Fri, 7 Feb 2020 17:47:52 +0100
Subject: [PATCH 2/2] Fix uninitialised memory write
If macTime() fails write zeros instead of unitialized memory to
the date fields.
---
write.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/write.c b/write.c
index 318adef..c8a86e4 100644
--- a/write.c
+++ b/write.c
@@ -434,8 +434,8 @@ fixupChecksum(FILE *out, int full_length, int head_position)
static int
writehead(FILE* out, FontPtr font)
{
- int time_hi;
- unsigned time_lo;
+ int time_hi = 0;
+ unsigned time_lo = 0;
macTime(&time_hi, &time_lo);
--
2.23.0

View file

@ -22,11 +22,6 @@ self: super:
buildInputs = attrs.buildInputs ++ [ self.xorgproto ];
});
fonttosfnt = super.fonttosfnt.overrideAttrs (attrs: {
# https://gitlab.freedesktop.org/xorg/app/fonttosfnt/merge_requests/6
patches = [ ./fix-uninitialised-memory.patch ];
});
bitmap = super.bitmap.overrideAttrs (attrs: {
nativeBuildInputs = attrs.nativeBuildInputs ++ [ makeWrapper ];
postInstall = ''

View file

@ -11,7 +11,7 @@ mirror://xorg/individual/app/appres-1.0.5.tar.bz2
mirror://xorg/individual/app/bdftopcf-1.1.tar.bz2
mirror://xorg/individual/app/bitmap-1.0.9.tar.gz
mirror://xorg/individual/app/editres-1.0.7.tar.bz2
mirror://xorg/individual/app/fonttosfnt-1.0.5.tar.bz2
mirror://xorg/individual/app/fonttosfnt-1.2.1.tar.bz2
mirror://xorg/individual/app/iceauth-1.0.8.tar.bz2
mirror://xorg/individual/app/ico-1.0.5.tar.bz2
mirror://xorg/individual/app/listres-1.0.4.tar.bz2