bubblewrap icon indicating copy to clipboard operation
bubblewrap copied to clipboard

bubblewrap misuses CMSG_DATA() macro

Open mcatanzaro opened this issue 1 year ago • 1 comments

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.)

mcatanzaro avatar Jun 20 '24 18:06 mcatanzaro