D11132: Avoid an asan runtime error

Jaime Torres Amate noreply at phabricator.kde.org
Wed Mar 7 15:35:45 UTC 2018


jtamate created this revision.
jtamate added a reviewer: Frameworks.
Restricted Application added a project: Frameworks.
jtamate requested review of this revision.

REVISION SUMMARY
  Initialize the arrays to the maximum size of the enums and use c++11 initialization to ensure that all values are set to zero (or equivalent).

TEST PLAN
  execute kdialog --getexistingdirectory smb://
  
  before the patch, the following messages from gcc asan are displayed:
  
  kdesrc/frameworks/kiconthemes/src/kiconeffect.cpp:170:51: runtime error: index 3 out of bounds for type 'int [3]'
  kdesrc/frameworks/kiconthemes/src/kiconeffect.cpp:172:51: runtime error: index 3 out of bounds for type 'float [3]'
  kdesrc/frameworks/kiconthemes/src/kiconeffect.cpp:174:40: runtime error: index 3 out of bounds for type 'bool [3]'
  kdesrc/frameworks/kiconthemes/src/kiconeffect.cpp:176:35: runtime error: index 3 out of bounds for type 'int [3]'
  kdesrc/frameworks/kiconthemes/src/kiconeffect.cpp:176:74: runtime error: index 3 out of bounds for type 'int [3]'
  kdesrc/frameworks/kiconthemes/src/kiconeffect.cpp:180:35: runtime error: index 3 out of bounds for type 'int [3]'
  
  This runtime error is not shown any more.

REPOSITORY
  R302 KIconThemes

REVISION DETAIL
  https://phabricator.kde.org/D11132

AFFECTED FILES
  src/kiconeffect.cpp

To: jtamate, #frameworks
Cc: michaelh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180307/004032ac/attachment.html>


More information about the Kde-frameworks-devel mailing list