Review Request: Fix KPixmapCache crash (probably because of pointer aliasing in unions)

Thiago Macieira thiago at kde.org
Fri May 29 07:10:31 BST 2009


Michael Pyne wrote:
>On Monday 25 May 2009 03:55:37 Johannes Sixt wrote:
>> No, don't ship it. The new code is just as wrong as the old code was.
>>
>> The new code uses the idiom
>>     *(some_type*)foo
>> where foo is of some_other_type. This breaks aliasing rules.
>
>I have a patch (attached) for the issue, which eliminates the union
> entirely. The portions of code needing a char* pointer to the beginning
> of mmap'ed memory get one using a reinterpret_cast, and the DataHeader
> alias was unneeded anyways from what I can tell.
>
>I plan to commit to 4.3 and 4.2 branches tonight after I do some testing
> here.

Patch looks sane.

Thanks
-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20090529/1b3a3c4c/attachment.sig>


More information about the kde-core-devel mailing list