Skip to content

Commit

Permalink
ProcSMapsFile might not be a valid file descriptor
Browse files Browse the repository at this point in the history
in which case don't send it, which then implies we might have
an empty shareFDs which we can treat the same as a nonexisting
shareFDs

Signed-off-by: Caolán McNamara <[email protected]>
Change-Id: I80a78a01c69dbee5ee28a64442a5069a6c2b4dbe
  • Loading branch information
caolanm authored and mmeeks committed Oct 14, 2023
1 parent a1b2091 commit 8d42849
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion kit/Kit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3167,7 +3167,8 @@ void lokit_main(
#if !MOBILEAPP

std::vector<int> shareFDs;
shareFDs.push_back(ProcSMapsFile);
if (ProcSMapsFile >= 0)
shareFDs.push_back(ProcSMapsFile);

if (isURPEnabled())
{
Expand Down
2 changes: 1 addition & 1 deletion net/Socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ bool SocketPoll::insertNewUnixSocket(
req.set("Pragma", "no-cache");

LOG_TRC("Requesting upgrade of websocket at path " << pathAndQuery << " #" << socket->getFD());
if (!shareFDs)
if (!shareFDs || shareFDs->empty())
{
socket->send(req);
}
Expand Down

0 comments on commit 8d42849

Please sign in to comment.