Skip to content

Commit

Permalink
cleanup(libsinsp): fix misaligned access to cmsghdr
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Guerra <[email protected]>
  • Loading branch information
LucaGuerra authored and poiana committed Feb 22, 2024
1 parent aad5f2a commit ff0ea6d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions userspace/libsinsp/parsers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4151,8 +4151,9 @@ void sinsp_parser::parse_rw_exit(sinsp_evt *evt)
parinfo = evt->get_param(4);
if(parinfo->m_len > sizeof(cmsghdr))
{
cmsghdr *cmsg = (cmsghdr *)parinfo->m_val;
if(cmsg->cmsg_type == SCM_RIGHTS)
cmsghdr cmsg;
memcpy(&cmsg, parinfo->m_val, sizeof(cmsghdr));
if(cmsg.cmsg_type == SCM_RIGHTS)
{
char error[SCAP_LASTERR_SIZE];
scap_threadinfo scap_tinfo {};
Expand Down

0 comments on commit ff0ea6d

Please sign in to comment.