1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-07 06:43:00 +03:00

debug: Improve fdelt_chk error message

It is not a "buffer overflow detected" but an out of range
bit on fd_set

Signed-off-by: Cristian Rodríguez <crrodriguez@opensuse.org>
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
This commit is contained in:
Cristian Rodríguez
2022-03-13 18:40:24 +00:00
committed by Siddhesh Poyarekar
parent 866c599182
commit 811c635dba

View File

@@ -15,6 +15,7 @@
License along with the GNU C Library; if not, see License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */ <https://www.gnu.org/licenses/>. */
#include <stdio.h>
#include <sys/select.h> #include <sys/select.h>
@@ -22,7 +23,7 @@ long int
__fdelt_chk (long int d) __fdelt_chk (long int d)
{ {
if (d < 0 || d >= FD_SETSIZE) if (d < 0 || d >= FD_SETSIZE)
__chk_fail (); __fortify_fail ("bit out of range 0 - FD_SETSIZE on fd_set");
return d / __NFDBITS; return d / __NFDBITS;
} }