Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
gexiv2
gexiv2
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 22
    • Issues 22
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 2
    • Merge Requests 2
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GNOME
  • gexiv2gexiv2
  • Issues
  • #42

Closed
Open
Opened Jul 08, 2019 by Ting-Wei Lan@lantwDeveloper

Crash on FreeBSD because of the use of Exiv2::Error

In header file exiv2/error.hpp, Exiv2::Error is declared as Exiv2::BasicError<char>, but Exiv2::BasicError isn't marked as EXIV2API, suggesting it isn't an exported type and should not be used by other libraries or applications. The use of Exiv2::Error in gexiv2 causes GNOME Photos to crash on FreeBSD because gexiv2_metadata_register_xmp_namespace relies on the ability to catch the exception thrown by Exiv2::XmpProperties::ns. Since typeinfo of Exiv2::BasicError isn't exported, libcxxrt doesn't know gexiv2_metadata_register_xmp_namespace catches the exception and aborts the program.

This problem can be avoided if Exiv2::Error is replaced by Exiv2::AnyError. Exiv2::AnyError is marked as EXIV2API, so it should be safe to use.

diff --git a/gexiv2/gexiv2-metadata-xmp.cpp b/gexiv2/gexiv2-metadata-xmp.cpp
index eac78b7..8c14e40 100644
--- a/gexiv2/gexiv2-metadata-xmp.cpp
+++ b/gexiv2/gexiv2-metadata-xmp.cpp
@@ -405,7 +405,7 @@ gboolean gexiv2_metadata_register_xmp_namespace (const gchar* name, const gchar*
 
     try {
         Exiv2::XmpProperties::ns(prefix);
-    } catch (Exiv2::Error& error) {
+    } catch (Exiv2::AnyError& error) {
         // No namespace, OK to register
         Exiv2::XmpProperties::registerNs(name, prefix);
         return TRUE;

Please see https://github.com/Exiv2/exiv2/issues/947 for more details.

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: GNOME/gexiv2#42