Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • gnome-shell gnome-shell
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 2.1k
    • Issues 2.1k
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 149
    • Merge requests 149
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • gnome-shellgnome-shell
  • Merge requests
  • !1302

shell-mime-sniffer: Ignore invalid file content type

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Marco Trevisan requested to merge 3v1n0/gnome-shell:sniffer-handle-invalid-mimetype into master Jun 05, 2020
  • Overview 0
  • Commits 1
  • Pipelines 2
  • Changes 1

The shell mime sniffer goes through all the files in a directory, however in case a file content type is not recognized, the GIO function g_file_info_get_content_type() may return NULL, causing a crash when looking up into the content type tables, as they are supposed to contain strings only and they use g_str_hash has func, which doesn't support NULL values.

So, in case we get an invalid content type, let's just ignore it, without adding it to the cache as we do in the nautilus code that was inspiring the sniffer.

Fixes #2643 (closed)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: sniffer-handle-invalid-mimetype