xorg-server: fix libfbdevhw

This commit is contained in:
newbluemoon 2018-10-21 22:59:17 +02:00 committed by maxice8
parent 8c82fdf9a6
commit c60992ac95
2 changed files with 27 additions and 1 deletions

View File

@ -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);

View File

@ -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