随笔-FD_SET崩溃(crash caused by FD_SET buffer overflow)

https://stackoverflow.com/questions/20618308/fd-set-causing-seg-fault
https://linux.die.net/man/3/fd_set

Notes
An fd_set is a fixed size buffer. Executing FD_CLR() or FD_SET() with a value of fd that is negative or is equal to or larger than FD_SETSIZE will result in undefined behavior. Moreover, POSIX requires fd to be a valid file descriptor.

posted @ 2024-07-24 10:32  LiYanbin  阅读(26)  评论(0编辑  收藏  举报