fix: only query valid FDs (#21)

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.
master
nullobsi 5 months ago committed by GitHub
parent 4d8cc8bd9d
commit f4fcc355bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -2127,7 +2127,7 @@ void CQnetGateway::Run()
// process packets coming from local repeater module(s) // process packets coming from local repeater module(s)
for (int i=0; i<3; i++) 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; SDSVT dsvt;
const ssize_t len = FromModem[i].Read(dsvt.title, 56); const ssize_t len = FromModem[i].Read(dsvt.title, 56);

Loading…
Cancel
Save

Powered by TurnKey Linux.