Re: [PATCH] winex11.drv: check for org = NULL (Coverity)
Hi Marcus, A couple of hours ago I submitted a patch rewrites the function. It suffers from the same 'issue'. This and any other wgl function are called from gdi32/opengl.c which perform magic to arrive here and in case of wglsharelists it also performs the filtering. Roderick On Sun, Nov 15, 2009 at 7:28 PM, Marcus Meissner <marcus(a)jet.franken.de> wrote:
Hi,
Coverity spotted some inconsistencies in "org" NULL checking.
org originates via Windows code (I think) so we better check it.
Ciao, Marcus --- dlls/winex11.drv/opengl.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 45da479..774b205 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -1918,11 +1918,15 @@ BOOL CDECL X11DRV_wglShareLists(HGLRC hglrc1, HGLRC hglrc2) {
if (!has_opengl()) return FALSE;
+ if (NULL == org) { + ERR("Could not share display lists, original context required.\n"); + return FALSE; + } if (NULL != dest && dest->ctx != NULL) { - ERR("Could not share display lists, context already created !\n"); + ERR("Could not share display lists, context already created!\n"); return FALSE; } else { - if(org && dest && (GetObjectType(org->hdc) == OBJ_MEMDC) ^ (GetObjectType(dest->hdc) == OBJ_MEMDC)) { + if(dest && (GetObjectType(org->hdc) == OBJ_MEMDC) ^ (GetObjectType(dest->hdc) == OBJ_MEMDC)) { WARN("Attempting to share a context between a direct and indirect rendering context, expect issues!\n"); }
-- 1.5.6
On Sun, Nov 15, 2009 at 10:37:27PM +0100, Roderick Colenbrander wrote:
Hi Marcus,
A couple of hours ago I submitted a patch rewrites the function. It suffers from the same 'issue'. This and any other wgl function are called from gdi32/opengl.c which perform magic to arrive here and in case of wglsharelists it also performs the filtering.
Do I understand right that this is actually something we should mark as FALSE or IGNORE in Coverity? Ciao, Marcus
Roderick
On Sun, Nov 15, 2009 at 7:28 PM, Marcus Meissner <marcus(a)jet.franken.de> wrote:
Hi,
Coverity spotted some inconsistencies in "org" NULL checking.
org originates via Windows code (I think) so we better check it.
Ciao, Marcus --- dlls/winex11.drv/opengl.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 45da479..774b205 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -1918,11 +1918,15 @@ BOOL CDECL X11DRV_wglShareLists(HGLRC hglrc1, HGLRC hglrc2) {
if (!has_opengl()) return FALSE;
+ if (NULL == org) { + ERR("Could not share display lists, original context required.\n"); + return FALSE; + } if (NULL != dest && dest->ctx != NULL) { - ERR("Could not share display lists, context already created !\n"); + ERR("Could not share display lists, context already created!\n"); return FALSE; } else { - if(org && dest && (GetObjectType(org->hdc) == OBJ_MEMDC) ^ (GetObjectType(dest->hdc) == OBJ_MEMDC)) { + if(dest && (GetObjectType(org->hdc) == OBJ_MEMDC) ^ (GetObjectType(dest->hdc) == OBJ_MEMDC)) { WARN("Attempting to share a context between a direct and indirect rendering context, expect issues!\n"); }
-- 1.5.6
-- Working, but not speaking, for the following german company: SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg)
On Mon, Nov 16, 2009 at 11:02 AM, Marcus Meissner <meissner(a)suse.de> wrote:
On Sun, Nov 15, 2009 at 10:37:27PM +0100, Roderick Colenbrander wrote:
Hi Marcus,
A couple of hours ago I submitted a patch rewrites the function. It suffers from the same 'issue'. This and any other wgl function are called from gdi32/opengl.c which perform magic to arrive here and in case of wglsharelists it also performs the filtering.
Do I understand right that this is actually something we should mark as FALSE or IGNORE in Coverity?
Yeah, it can be set to ignore. Roderick
participants (2)
-
Marcus Meissner -
Roderick Colenbrander