As pointed out by Johannes Wörner, para_audioc crashes on recent
Ubuntu systems due to stack smashing. This is caused by writing past
the end of the control buffer which stores the message header and
the socket credentials.
This patch fixes the bug by allocating a properly sized buffer.
*/
ssize_t send_cred_buffer(int sock, char *buf)
{
- char control[sizeof(struct cmsghdr) + 10];
+ char control[sizeof(struct cmsghdr) + sizeof(struct ucred)];
struct msghdr msg;
struct cmsghdr *cmsg;
static struct iovec iov;