From c60992ac95a8e2aaff53adddc3cb06f171ebe734 Mon Sep 17 00:00:00 2001 From: newbluemoon Date: Sun, 21 Oct 2018 22:59:17 +0200 Subject: [PATCH] xorg-server: fix libfbdevhw --- .../xorg-server/patches/fix-libfbdevhw.patch | 26 +++++++++++++++++++ srcpkgs/xorg-server/template | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/xorg-server/patches/fix-libfbdevhw.patch diff --git a/srcpkgs/xorg-server/patches/fix-libfbdevhw.patch b/srcpkgs/xorg-server/patches/fix-libfbdevhw.patch new file mode 100644 index 00000000000..14d29b00bcb --- /dev/null +++ b/srcpkgs/xorg-server/patches/fix-libfbdevhw.patch @@ -0,0 +1,26 @@ +source upstream master: + +Misplaced parenthesis caused us to compare the sizeof, +not the readlink return value. +https://gitlab.freedesktop.org/xorg/xserver/commit/bd5fe7593fd0df236f3b2be1f062166ddba7d67c + +ensure the readlink buffer is null-terminated +https://gitlab.freedesktop.org/xorg/xserver/commit/71703e4e8bd00719eefad53c2ed6c604079f87ea + +--- hw/xfree86/fbdevhw/fbdevhw.c.orig ++++ hw/xfree86/fbdevhw/fbdevhw.c +@@ -331,12 +331,12 @@ + + /* only touch non-PCI devices on this path */ + { +- char buf[PATH_MAX]; ++ char buf[PATH_MAX] = {0}; + char *sysfs_path = NULL; + char *node = strrchr(dev, '/') + 1; + + if (asprintf(&sysfs_path, "/sys/class/graphics/%s", node) < 0 || +- readlink(sysfs_path, buf, sizeof(buf) < 0) || ++ readlink(sysfs_path, buf, sizeof(buf) - 1) < 0 || + strstr(buf, "devices/pci")) { + free(sysfs_path); + close(fd); diff --git a/srcpkgs/xorg-server/template b/srcpkgs/xorg-server/template index 732120d63e9..0e2b062e282 100644 --- a/srcpkgs/xorg-server/template +++ b/srcpkgs/xorg-server/template @@ -1,7 +1,7 @@ # Template file for 'xorg-server' pkgname=xorg-server version=1.20.2 -revision=1 +revision=2 build_style=meson configure_args="-Dipv6=true -Dxorg=true -Dxnest=true -Dxephyr=true -Dxvfb=true -Dhal=false -Dudev=true -Dxkb_dir=/usr/share/X11/xkb