Bug 108465 - xorg-server-1.20.2/hw/xfree86/fbdevhw/fbdevhw.c:339: possible ")" in wrong place ?
Summary: xorg-server-1.20.2/hw/xfree86/fbdevhw/fbdevhw.c:339: possible ")" in wrong pl...
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-17 07:40 UTC by dcb314
Modified: 2018-10-17 17:02 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description dcb314 2018-10-17 07:40:07 UTC
xorg-server-1.20.2/hw/xfree86/fbdevhw/fbdevhw.c:339]: (style) Checking if unsigned variable 'sizeof(buf)' is less than zero.

Source code is

        if (asprintf(&sysfs_path, "/sys/class/graphics/%s", node) < 0 ||
            readlink(sysfs_path, buf, sizeof(buf) < 0) ||
            strstr(buf, "devices/pci")) {

Maybe better code

        if (asprintf(&sysfs_path, "/sys/class/graphics/%s", node) < 0 ||
            readlink(sysfs_path, buf, sizeof(buf)) < 0 ||
            strstr(buf, "devices/pci")) {
Comment 1 Alan Coopersmith 2018-10-17 17:02:00 UTC
Already fixed yesterday:
https://gitlab.freedesktop.org/xorg/xserver/commit/71703e4e8bd00719eefad53c2ed6c604079f87ea

Thanks for the report!
Comment 2 Alan Coopersmith 2018-10-17 17:02:59 UTC
Sorry, wrong commit link, should have been:
https://gitlab.freedesktop.org/xorg/xserver/commit/bd5fe7593fd0df236f3b2be1f062166ddba7d67c


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.