Module: Mesa
Branch: master
Commit: c0580f6a3859ec373ed11b3a6266c9b94d01a343
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c0580f6a3859ec373ed11b3a6266c9b94d01a343

Author: Nicolas Boichat <[email protected]>
Date:   Thu Aug  4 10:07:54 2016 +0800

egl/android: Set dpy->DriverData to NULL on error

Avoid use-after-free on error.

Fixes: 9ee683f877 (egl/dri2: Add reference count for dri2_egl_display)
Cc: "12.0" <[email protected]>
Signed-off-by: Nicolas Boichat <[email protected]>
Tested-by: Martin Peres <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>

---

 src/egl/drivers/dri2/platform_android.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/egl/drivers/dri2/platform_android.c 
b/src/egl/drivers/dri2/platform_android.c
index 925c1a5..e7b30b4 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -984,6 +984,7 @@ cleanup_device:
    close(dri2_dpy->fd);
 cleanup_display:
    free(dri2_dpy);
+   dpy->DriverData = NULL;
 
    return _eglError(EGL_NOT_INITIALIZED, err);
 }

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to