fix: only query valid FDs

On hardened glibc, calling FD_ISSET with an FD <0 or >FD_SETSIZE causes
a SIGABRT. Only query FDs that are associated with enabled repeater
modules to work around this crash.
pull/21/head
Citlali del Rey 5 months ago
parent 4d8cc8bd9d
commit 5b41d9e134
No known key found for this signature in database
GPG Key ID: 342661C4F68CD06D

@ -2127,7 +2127,7 @@ void CQnetGateway::Run()
// process packets coming from local repeater module(s)
for (int i=0; i<3; i++)
{
if (keep_running && FD_ISSET(FromModem[i].GetFD(), &fdset))
if (keep_running && Rptr.mod[i].defined && FD_ISSET(FromModem[i].GetFD(), &fdset))
{
SDSVT dsvt;
const ssize_t len = FromModem[i].Read(dsvt.title, 56);

Loading…
Cancel
Save

Powered by TurnKey Linux.