xserver: Branch 'master' - 3 commits
Adam Jackson
ajax at kemper.freedesktop.org
Wed Mar 2 15:04:05 UTC 2016
Xext/xvmain.c | 11 ++++++-----
hw/xfree86/dri/dri.c | 8 +++++---
2 files changed, 11 insertions(+), 8 deletions(-)
New commits:
commit 939ce0bae68b682b57675f65c901653c1a094ebb
Author: Julien Cristau <jcristau at debian.org>
Date: Tue Mar 1 21:39:01 2016 +0100
xv: fix double free in AddResource failure case
XvdiDestroyVideoNotifyList already frees the list if AddResource fails,
so don't do it twice. And set tpn->client to NULL explicitly to avoid
confusing uninitialized memory with a valid value.
Reviewed-by: Adam Jackson <ajax at redhat.com>
Signed-off-by: Julien Cristau <jcristau at debian.org>
diff --git a/Xext/xvmain.c b/Xext/xvmain.c
index 3a02634..c9b11d4 100644
--- a/Xext/xvmain.c
+++ b/Xext/xvmain.c
@@ -800,10 +800,9 @@ XvdiSelectVideoNotify(ClientPtr client, DrawablePtr pDraw, BOOL onoff)
if (!(tpn = malloc(sizeof(XvVideoNotifyRec))))
return BadAlloc;
tpn->next = NULL;
- if (!AddResource(pDraw->id, XvRTVideoNotifyList, tpn)) {
- free(tpn);
+ tpn->client = NULL;
+ if (!AddResource(pDraw->id, XvRTVideoNotifyList, tpn))
return BadAlloc;
- }
}
else {
/* LOOK TO SEE IF ENTRY ALREADY EXISTS */
commit 05e1bcf56e1c511a1ef539acfe11e37727e1179e
Author: Adam Jackson <ajax at redhat.com>
Date: Tue Mar 1 14:09:30 2016 -0500
dri1: Fix unchecked AddResource
Signed-off-by: Adam Jackson <ajax at redhat.com>
Reviewed-by: Julien Cristau <jcristau at debian.org>
diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c
index 875c9cc..0046e52 100644
--- a/hw/xfree86/dri/dri.c
+++ b/hw/xfree86/dri/dri.c
@@ -1032,7 +1032,8 @@ DRICreateContext(ScreenPtr pScreen, VisualPtr visual,
}
/* track this in case the client dies before cleanup */
- AddResource(context, DRIContextPrivResType, (void *) pDRIContextPriv);
+ if (!AddResource(context, DRIContextPrivResType, (void *) pDRIContextPriv))
+ return FALSE;
return TRUE;
}
@@ -1263,8 +1264,9 @@ DRICreateDrawable(ScreenPtr pScreen, ClientPtr client, DrawablePtr pDrawable,
}
/* track this in case the client dies */
- AddResource(FakeClientID(client->index), DRIDrawablePrivResType,
- (void *) (intptr_t) pDrawable->id);
+ if (!AddResource(FakeClientID(client->index), DRIDrawablePrivResType,
+ (void *) (intptr_t) pDrawable->id))
+ return FALSE;
if (pDRIDrawablePriv->hwDrawable) {
drmUpdateDrawableInfo(pDRIPriv->drmFD,
commit 093f9505c12565cc19bdf6e33b263f31d104c3ef
Author: Adam Jackson <ajax at redhat.com>
Date: Tue Mar 1 14:09:29 2016 -0500
xv: Fix unchecked AddResource
Reviewed-by: Julien Cristau <jcristau at debian.org>
Signed-off-by: Adam Jackson <ajax at redhat.com>
diff --git a/Xext/xvmain.c b/Xext/xvmain.c
index 0c6f25b..3a02634 100644
--- a/Xext/xvmain.c
+++ b/Xext/xvmain.c
@@ -844,7 +844,8 @@ XvdiSelectVideoNotify(ClientPtr client, DrawablePtr pDraw, BOOL onoff)
tpn->client = NULL;
tpn->id = FakeClientID(client->index);
- AddResource(tpn->id, XvRTVideoNotify, tpn);
+ if (!AddResource(tpn->id, XvRTVideoNotify, tpn))
+ return BadAlloc;
tpn->client = client;
return Success;
@@ -893,7 +894,8 @@ XvdiSelectPortNotify(ClientPtr client, XvPortPtr pPort, BOOL onoff)
tpn->client = client;
tpn->id = FakeClientID(client->index);
- AddResource(tpn->id, XvRTPortNotify, tpn);
+ if (!AddResource(tpn->id, XvRTPortNotify, tpn))
+ return BadAlloc;
return Success;
More information about the xorg-commit
mailing list