D16165: Don't crash on invalid exiv2 data

Stefan BrĂ¼ns noreply at phabricator.kde.org
Fri Oct 12 21:01:51 BST 2018


bruns added a comment.


  Can you enhance the Summary a little bit?
  
  It took me some time to notice `Exiv2::Value::toFloat()` is the same as `Exiv2::Value::toFloat(0)` (default argument), and accessing an inexisting element (i.e. n >= count()) triggers undefined behaviour, according to the Exiv2 documentation.
  
  Can you remove the "tries to look for **two** numbers" from the summary - IMHO it is misleading, as although a rational consist of numerator and denumerator, it is still 1 element (i.e. `count() >= 1` is sufficient).
  
  Also, `size()` denotes the size in bytes, while we want the number of elements, i.e. `count()`, see `Exiv2Extractor::fetchGpsDouble` here and the Exiv2 API <http://www.exiv2.org/doc/classExiv2_1_1Value.html>.

REPOSITORY
  R286 KFileMetaData

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

To: poboiko, #baloo, #frameworks
Cc: bruns, astippich, kde-frameworks-devel, ashaposhnikov, michaelh, spoorun, ngraham, abrahams
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20181012/d58b50e0/attachment.html>


More information about the Kde-frameworks-devel mailing list