[Mesa-dev] [PATCH 1/3] glx: Check malloc return value before accessing memory in glx/clientattrib.c

Juha-Pekka Heikkilä juhapekka.heikkila at gmail.com
Tue Dec 3 12:25:44 PST 2013


On Tue, Dec 3, 2013 at 6:39 PM, Brian Paul <brianp at vmware.com> wrote:
> On 12/02/2013 02:39 AM, Juha-Pekka Heikkila wrote:
>>
>> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
>> ---
>>   src/glx/clientattrib.c | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/src/glx/clientattrib.c b/src/glx/clientattrib.c
>> index 1b306ea..a26906f 100644
>> --- a/src/glx/clientattrib.c
>> +++ b/src/glx/clientattrib.c
>> @@ -76,6 +76,11 @@ __indirect_glPushClientAttrib(GLuint mask)
>>      if (spp < &gc->attributes.stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]) {
>>         if (!(sp = *spp)) {
>>            sp = malloc(sizeof(__GLXattribute));
>> +
>> +         if (sp == NULL) {
>> +            __glXSetError(gc, GL_OUT_OF_MEMORY);
>> +            return;
>> +         }
>>            *spp = sp;
>>         }
>>         sp->mask = mask;
>>
>
> Reviewed-by: Brian Paul <brianp at vmware.com>
>
> Need someone to push this for you?
>

Thank you, it would be good if someone can push the patches that look
good since I cannot push these.

/Juha-Pekka


More information about the mesa-dev mailing list