[PATCH] debug: Improve fdelt_chk error message

Siddhesh Poyarekar siddhesh@gotplt.org
Mon Mar 14 08:23:15 GMT 2022


On 14/03/2022 00:10, Cristian Rodríguez via Libc-alpha wrote:
> 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>

Agreed.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>


> ---
>   debug/fdelt_chk.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/debug/fdelt_chk.c b/debug/fdelt_chk.c
> index c5f16462ad..30f5a4bec1 100644
> --- a/debug/fdelt_chk.c
> +++ b/debug/fdelt_chk.c
> @@ -15,6 +15,7 @@
>      License along with the GNU C Library; if not, see
>      <https://www.gnu.org/licenses/>.  */
>   
> +#include <stdio.h>
>   #include <sys/select.h>
>   
>   
> @@ -22,7 +23,7 @@ long int
>   __fdelt_chk (long int d)
>   {
>     if (d < 0 || d >= FD_SETSIZE)
> -    __chk_fail ();
> +    __fortify_fail ("bit out of range 0 - FD_SETSIZE on fd_set");
>   
>     return d / __NFDBITS;
>   }



More information about the Libc-alpha mailing list