Skip to content

bubblewrap misuses CMSG_DATA() macro #637

@mcatanzaro

Description

@mcatanzaro

cmsg(3) says:

       CMSG_DATA()
              returns  a pointer to the data portion of a cmsghdr.  The pointer returned cannot be assumed to be suitably aligned for accessing arbitrary
              payload data types.  Applications should not cast it to a pointer type matching the payload, but should instead use memcpy(3) to copy  data
              to or from a suitably declared object.

send_pid_on_socket() and read_pid_from_socket() in bubblewrap's utils.c both cast the return value exactly like the documentation says not to do.

(This should be a very easy newcomers issue.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions