Review Request 118750: Prevent use after free

Thomas Lübking thomas.luebking at gmail.com
Sun Jun 15 01:56:24 BST 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/118750/#review60114
-----------------------------------------------------------



plasma-desktop/kcms/keyboard/preview/keysymhelper.cpp
<https://git.reviewboard.kde.org/r/118750/#comment41850>

    KeySym keysym = XStringToKeysym(opton.toLatin1().constData()); ?
    
    - str is a a buffer var for the next line only anyway
    - toAscii() is deprecated
    - data() can cause a deep copy (though i don't think in this case, nevertheless)


- Thomas Lübking


On June 14, 2014, 10:09 p.m., Fabian Kosmale wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/118750/
> -----------------------------------------------------------
> 
> (Updated June 14, 2014, 10:09 p.m.)
> 
> 
> Review request for kde-workspace and Andriy Rysin.
> 
> 
> Repository: kde-workspace
> 
> 
> Description
> -------
> 
> Prior to this patch, the memory str was pointing to was freed once the ; was reached. By storing the result of opton.toAscii(), the memory is "kept alive".
> 
> 
> Diffs
> -----
> 
>   plasma-desktop/kcms/keyboard/preview/keysymhelper.cpp 67beb80db594f8a26dcfd3ad172604888080d205 
> 
> Diff: https://git.reviewboard.kde.org/r/118750/diff/
> 
> 
> Testing
> -------
> 
> Only recompiled the application so far.
> 
> 
> Thanks,
> 
> Fabian Kosmale
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20140615/23a89318/attachment.htm>


More information about the kde-core-devel mailing list