Skip to content

Commit

Permalink
TerminalShell (Linux): fix segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
CarterLi committed Jan 23, 2024
1 parent ee60ec3 commit 79ba9d7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/detection/terminalshell/terminalshell_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,13 @@ static const char* getProcessNameAndPpid(pid_t pid, char* name, pid_t* ppid, int
)
return "sscanf(stat) failed";

if (tty && (tty_ >> 8) == 0x88)
*tty = tty_ & 0xFF;
else
*tty = -1;
if (tty)
{
if ((tty_ >> 8) == 0x88)
*tty = tty_ & 0xFF;
else
*tty = -1;
}

#elif defined(__APPLE__)

Expand Down

0 comments on commit 79ba9d7

Please sign in to comment.