Skip to content

Crash when parsing malformed XML after rxkb_context_parse() due to error handler not being reset #529

Description

@sbstnk

We got a report of gnome-shell crashing when libgweather is trying to parse malformed XML after gnome-shell has previously called (via gnome-desktop) something like:

rxkb_context_new();
rxkb_context_parse();
rxkb_context_unref();

rxkb_context_parse() calls xmlSetGenericErrorFunc() via parse() to set the global libxml2 error handler to its xml_error_func(), which depends on a valid rxkb_context. The context however is no longer valid after rxkb_context_unref(), while the error handler is still pointing to xml_error_func() . This then results in a crash whenever something causes libxml2 to trigger an error afterwards, such as libgweather in the gnome-shell report.

parse() should restore the default error handler after it is done parsing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorregistryIndicates a need for improvements or additions to Registry

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions