From: "Christian König" <deathsimple@vodafone.de>
To: Jammy Zhou <Jammy.Zhou@amd.com>,
dri-devel@lists.freedesktop.org, master.homer@gmail.com
Subject: Re: [PATCH] drm: fix the usage after free
Date: Mon, 24 Aug 2015 09:51:57 +0200 [thread overview]
Message-ID: <55DACD1D.1050600@vodafone.de> (raw)
In-Reply-To: <1440388573-2065-1-git-send-email-Jammy.Zhou@amd.com>
On 24.08.2015 05:56, Jammy Zhou wrote:
> From: Mathias Tillman <master.homer@gmail.com>
>
> For readdir_r(), the next directory entry is returned in caller-allocted
> buffer (pointered by pent here).
>
> https://bugs.freedesktop.org/show_bug.cgi?id=91704
>
> Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Would be more convenient if Mathias would add his Signed-off-by as well
and send out the patch, cause he is the original author.
Anyway the patch is clearly a nice catch and Reviewed-by: Christian
König <christian.koenig@amd.com>
Regards,
Christian.
> ---
> xf86drm.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/xf86drm.c b/xf86drm.c
> index 5e02969..a7cc643 100644
> --- a/xf86drm.c
> +++ b/xf86drm.c
> @@ -2803,11 +2803,12 @@ static char *drmGetMinorNameForFD(int fd, int type)
>
> while (readdir_r(sysdir, pent, &ent) == 0 && ent != NULL) {
> if (strncmp(ent->d_name, name, len) == 0) {
> + snprintf(dev_name, sizeof(dev_name), DRM_DIR_NAME "/%s",
> + ent->d_name);
> +
> free(pent);
> closedir(sysdir);
>
> - snprintf(dev_name, sizeof(dev_name), DRM_DIR_NAME "/%s",
> - ent->d_name);
> return strdup(dev_name);
> }
> }
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2015-08-24 7:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-24 3:56 [PATCH] drm: fix the usage after free Jammy Zhou
2015-08-24 7:51 ` Christian König [this message]
2015-08-24 7:59 ` Zhou, Jammy
2015-08-24 8:03 ` Mathias Tillman
2015-08-24 8:20 ` Christian König
2015-08-24 8:28 ` Mathias Tillman
2015-08-24 14:30 ` Emil Velikov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55DACD1D.1050600@vodafone.de \
--to=deathsimple@vodafone.de \
--cc=Jammy.Zhou@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=master.homer@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.