D20877: Fix exivextractor crash with malformed files

Stefan BrĂ¼ns noreply at phabricator.kde.org
Sun Apr 28 15:26:17 BST 2019


bruns added inline comments.

INLINE COMMENTS

> astippich wrote in exiv2extractor.cpp:299
> Unfortunately, empty() does not exist. Same was done in https://phabricator.kde.org/D16165

Yes, probably as `count()` is O(1).

> exiv2extractor.cpp:303
>          it = data.findKey(Exiv2::ExifKey("Exif.GPSInfo.GPSAltitudeRef"));
>          if ((ratio.second != 0) && (it != data.end()) && (it->value().typeId() == Exiv2::unsignedByte || it->value().typeId() == Exiv2::signedByte)) {
>              auto altRef = it->value().toLong();

Shouldn't there be  a check here as well? And probably move the `ratio.second` to after its assignment and immediately return.

REPOSITORY
  R286 KFileMetaData

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

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


More information about the Kde-frameworks-devel mailing list