Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • G GLib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 854
    • Issues 854
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 55
    • Merge requests 55
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • GLib
  • Merge requests
  • !2915

Consider the GLogField.length of "MESSAGE"/"GLIB_DOMAIN" fields in g_log_writer_format_fields()

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Sebastian Dröge requested to merge sdroege/glib:log-field-nul-termination into main Sep 22, 2022
  • Overview 4
  • Commits 1
  • Pipelines 1
  • Changes 1

Previously it was wrongly assuming that a NUL-termianted string is passed and the whole string should be written out.

Also document this bug in the documentation of g_log_structured() to avoid surprises when using older GLib versions.


This might also be a candidate to backport to GLib 2.74 (needs docs updates then of course).

This problem was noticed with the Rust bindings where garbage was printed out because strings were not NUL-terminated (as Rust strings are not NUL-terminated but array/length tuples), see https://github.com/gtk-rs/gtk-rs-core/issues/769.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: log-field-nul-termination