| Summary: | Crash when loading metadata for specially-crafted JPEG images | ||
|---|---|---|---|
| Product: | [Applications] digikam | Reporter: | saaman1377 |
| Component: | Metadata-Engine | Assignee: | Digikam Developers <digikam-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | crash | CC: | metzpinguin |
| Priority: | NOR | ||
| Version First Reported In: | 7.4.0 | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/graphics/digikam/commit/80a4117acbbcc81a3cbeb512372457f038f8c666 | Version Fixed/Implemented In: | 7.5.0 |
| Sentry Crash Report: | |||
| Attachments: | Image file generated by afl-fuzz which can be used to reproduce the crash | ||
|
Description
saaman1377
2021-12-23 07:27:45 UTC
Yes, the problem is clear, we have to check with ExifData::size(). I fix this tonight... Maik Git commit 80a4117acbbcc81a3cbeb512372457f038f8c666 by Maik Qualmann. Committed on 23/12/2021 at 19:35. Pushed by mqualmann into branch 'master'. check ExifData before convert to rational value FIXED-IN: 7.5.0 M +1 -1 NEWS M +8 -5 core/libs/metadataengine/engine/metaengine_exif.cpp M +10 -0 core/libs/metadataengine/engine/metaengine_xmp.cpp https://invent.kde.org/graphics/digikam/commit/80a4117acbbcc81a3cbeb512372457f038f8c666 Maik, Thank you for the prompt response and fix. Do you think it would make more sense, though, to introduce checks like "if (component < (*it).count())" instead of "if ((*it).count())" since component is a parameter that can be set to values other than 0? (I'm not sure there are currently any usages that specify other values, but this seems like a sensible precaution to avoid future problems.) I don't think the "component" parameter is a problem, most of the checks are <= 0. Maik Maik, I agree that it's unlikely to be an immediate problem; I was just thinking that it could be an issue in the future. I'm not very experienced with this code base, though, so I'll defer to your expertise on this. |