Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • X xev
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • 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
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • xorgxorg
  • app
  • xev
  • Merge requests
  • !7

Fix overflow on XmbLookupString buffer

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Alan Coopersmith requested to merge alanc/xev:patch into master Jul 17, 2022
  • Overview 0
  • Commits 1
  • Pipelines 1
  • Changes 1

The returned nmbbytes value is the length we need the buffer to be, but the current size is only bsize. We can't store a NUL at buf[nmbbytes] before the realloc, so only do this when the buffer is sized properly.

Signed-off-by: Mikael Magnusson <mikachu@gmail.com>
[ismael@iodev.co.uk: Moved string termination out of the loop]
Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Edited Jul 17, 2022 by Alan Coopersmith
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: patch