[Mesa-dev] [PATCH 3/3] glx: add missing null check in SendMakeCurrentRequest

Juha-Pekka Heikkilä juhapekka.heikkila at gmail.com
Tue Feb 11 06:27:49 PST 2014


Ah, you're correct. I'll fix that.

/Juha-Pekka

On Tue, Feb 11, 2014 at 4:18 PM, Petri Latvala <petri.latvala at intel.com> wrote:
> On 02/11/2014 04:07 PM, Juha-Pekka Heikkila wrote:
>>
>> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
>> ---
>>   src/glx/indirect_glx.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/glx/indirect_glx.c b/src/glx/indirect_glx.c
>> index 28b8cd0..41048f4 100644
>> --- a/src/glx/indirect_glx.c
>> +++ b/src/glx/indirect_glx.c
>> @@ -84,7 +84,7 @@ SendMakeCurrentRequest(Display * dpy, CARD8 opcode,
>>          * not the SGI extension.
>>          */
>>   -      if ((priv->majorVersion > 1) || (priv->minorVersion >= 3)) {
>> +      if (priv && (priv->majorVersion > 1) || (priv->minorVersion >= 3))
>> {
>>            xGLXMakeContextCurrentReq *req;
>>              GetReq(GLXMakeContextCurrent, req);
>
>
> If priv is NULL, this code still accesses priv->minorVersion. You need
>
>   if (priv && ((priv->majorVersion > 1) || (priv->minorVersion >= 3)))
>
>
>
> --
> Petri Latvala
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list