[PATCH 2/2] xkb: strdup the values returned by XkbGetRulesDflts

Daniel Stone daniel at fooishbar.org
Wed Apr 15 23:02:19 PDT 2009


On Wed, Apr 15, 2009 at 03:43:39PM +1000, Peter Hutterer wrote:
> XkbGetRulesDftls may get a copy of what will later be freed when passed into
> XkbSetRulesDftls.
> 
> On the second run of XkbGet/SetRulesDflts:
> XkbGetRulesDflts(rmlvo)
>         rmlvo->rules = current-rules
> 
> XkbSetRulesDflts(rmlvo)
>         free(current-rules)
>         current-rules = strdup(rmlvo->rules)
> 
> Leaving us with garbage in current-rules.
> 
> This patch requires callers of XkbGetRulesDflts to free the associated memory.
> 
> See also
> http://lists.freedesktop.org/archives/xorg-devel/2009-February/000305.html
> 
> Reported-by: Benjamin Close <Benjamin.Close at clearchain.com>
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

Signed-off-by: Daniel Stone <daniel at fooishbar.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://lists.x.org/archives/xorg-devel/attachments/20090416/c7d8be9e/attachment.pgp 


More information about the xorg-devel mailing list