[Bug 243283] graphics/libdrm: update to 2.4.100

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Jan 12 02:41:24 UTC 2020


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=243283

--- Comment #2 from Jan Beich <jbeich at FreeBSD.org> ---
Comment on attachment 210648
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=210648
libdrm2.4.100

Alternative version:
https://github.com/myfreeweb/freebsd-ports-dank/commit/90125516c6c7

> -PORTEPOCH=	1
> +PORTEPOCH=	2

Why?

>  #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
[...]
>  #else
> -    struct stat sbuf;
> -    char buf[PATH_MAX + 1];
> +    stat_t sbuf;
> +    char buf[DRM_NODE_NAME_MAX];
>      const char *dev_name = drmGetDeviceName(type);
>      unsigned int maj, min;
>      int n;
>  
> +    if (!dev_name)
> +        return NULL;
> +
>      if (fstat(fd, &sbuf))
>          return NULL;
>  
>      maj = major(sbuf.st_rdev);
>      min = minor(sbuf.st_rdev);
>  
>      if (!drmNodeIsDRM(maj, min) || !S_ISCHR(sbuf.st_mode))
>          return NULL;
>  
>      if (!dev_name)
>          return NULL;

Looks bogus:
- POSIX fstat() writes |struct stat| into the 2nd argument
- dev_name is already tested against NULL a few lines later
- buf[DRM_NODE_NAME_MAX] maybe too small to fit dev_name + DRM_DIR_NAME

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-x11 mailing list