Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • L libXRes
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1
    • Issues 1
    • 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

Due to an influx of spam, we have had to impose restrictions on new accounts. Please see this wiki page for instructions on how to get full permissions. Sorry for the inconvenience.

  • xorgxorg
  • lib
  • libXRes
  • Issues
  • #3
Closed
Open
Issue created May 15, 2020 by Daniel Abrecht@DPA

Bugs regarding the allocation of XResClientIdValue::value in ReadClientValues, which is used in XResQueryClientIds

This is about these two lines of code: https://gitlab.freedesktop.org/xorg/lib/libxres/-/blob/97d312e5fd9b4b97e3f50c899a40325768f246a5/src/XRes.c#L258-259

I think there isn't enough memory allocated for the _XRead32. If I understand that function correctly, while it reads the number of bytes specified, it returns/writes one long for every 32bit of data. On a 64bit system, a long is usually 8 bytes big. The memory allocated is only the number of bytes read, not the number of space the long values would need. This causes twice as much memory to be overwritten as was allocated on 64bit system.

Another thing which seams odd to me about this is that the memory is allocated there, and not in XResQueryClientIds as part of the memory allocated for the client_ids. Is the caller of XResQueryClientIds really supposed to free all these values by himself?

And the last thing I wonder about, why is XResClientIdValue::value of type void*, shouldn't it be of type long*? According to the spec here: https://www.x.org/releases/X11R7.7/doc/resourceproto/resproto.txt It says client_ids: LISTofCLIENTIDVALUE and

CLIENTIDVALUE [ spec:   CLIENTIDSPEC
                length: CARD32
                value:  LISTofCARD32 ]

And I think CARD32 seams to usually be translated to a long in the libraries other data structures?

(Closed previous identical issue 2 which I marked as confidential because noone responded to it in over a month and I can't unmark it anymore.)

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking