Use poll() instead of select()
From [Pcsclite-muscle] select()-induced crashes (and attached tentative fix) http://lists.infradead.org/pipermail/pcsclite-muscle/2019-November/001199.html " Hello all, we tracked down some crashes in Firefox [1] to the use of select() and its related macros in the libpcslite library. Recent versions of glibc added checks to ensure that the values of the file descriptors passed to the FD_SET(), FD_CLR() and FD_ISSET() macros have values lower than the FD_SETSIZE constant. If the file descriptor value is found to be higher than FD_SETSIZE then abort() gets called which is ultimately what we're seeing in Firefox. I have attached a patch that replaces the select() calls with poll() which does not suffer from this problem. Unfortunately I don't have a smartcard reader on hand so I can't test the patch myself. Cheers, Gabriele Svelto [1] select() crashes in libpcslite https://bugzilla.mozilla.org/show_bug.cgi?id=1591876 " Fixes github issue https://github.com/LudovicRousseau/PCSC/issues/51 "Using 'select' in libpcsclite can be problematic for application opening a large number of file descriptors #51"
Loading
Please register or sign in to comment