On Wed, Jul 28, 2010 at 1:58 AM, Peter Hutterer
<[email protected]> wrote:
> On Tue, Jul 27, 2010 at 03:09:46PM +0300, Pauli Nieminen wrote:
>> This prevents validation code from using uninitialized values.
>>
Fixes:
uninit_use_in_call: Using uninitialized element of array "symsPerKey"
in call to function "CheckKeyActions"

>> Signed-off-by: Pauli Nieminen <[email protected]>
>> ---
>>  xkb/xkb.c |    8 ++++++++
>>  1 files changed, 8 insertions(+), 0 deletions(-)
>>
>> diff --git a/xkb/xkb.c b/xkb/xkb.c
>> index 935f5ea..9a5d5b3 100644
>> --- a/xkb/xkb.c
>> +++ b/xkb/xkb.c
>> @@ -2366,6 +2366,14 @@ _XkbSetMapChecks(ClientPtr client, DeviceIntPtr dev, 
>> xkbSetMapReq *req, char* va
>>       }
>>      }
>>
>> +    if ((!(req->present & XkbKeySymsMask) &&
>> +         (req->present & XkbKeyActionsMask)) ||
>> +     (!(req->present & XkbKeyTypesMask) &&
>> +         (req->present & XkbKeySymsMask))) {
>> +     client->errorValue = req->present;
>> +     return BadMatch;
>> +    }
>> +
>>      if ((req->present & XkbKeyTypesMask) &&
>>       (!CheckKeyTypes(client,xkb,req,(xkbKeyTypeWireDesc **)&values,
>>                                               &nTypes,mapWidths))) {
>> --
>> 1.6.3.3
>
> What was the error message that triggered this patch? It's not really
> obvious from the patch or from the current code.
>

Problem is that CheckKeySyms initializes symsPerKey which is then read
in CheckKeyActions. If XkbKeyActionsMask is set without XkbKeySymsMask
that would cause validation to use uninitialized values from the
array.

Same dependency also applies for CheckKeyTypes and CheckKeySyms.

> Cheers,
>  Peter
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to