From 38e960b7aa84dae94be7962d7d70f1f32b87cce6 Mon Sep 17 00:00:00 2001 From: Narayan Kamath Date: Wed, 14 Mar 2018 12:37:25 +0000 Subject: [PATCH] bionic_fortify: clarify error message for an out of bounds FD. It seems clearer to include FD_SETSIZE in the message. set_size is sizeof(fd_set) so there's an extra mental hoop to jump if that's in the error message. Test: make Change-Id: I5cdb62465b658ac0eaeccbfb826d135820cf613a --- libc/private/bionic_fortify.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/private/bionic_fortify.h b/libc/private/bionic_fortify.h index 7f22963cb..3c3292e58 100644 --- a/libc/private/bionic_fortify.h +++ b/libc/private/bionic_fortify.h @@ -52,7 +52,7 @@ static inline void __check_fd_set(const char* fn, int fd, size_t set_size) { __fortify_fatal("%s: file descriptor %d < 0", fn, fd); } if (__predict_false(fd >= FD_SETSIZE)) { - __fortify_fatal("%s: file descriptor %d >= FD_SETSIZE %zu", fn, fd, set_size); + __fortify_fatal("%s: file descriptor %d >= FD_SETSIZE %zu", fn, fd, FD_SETSIZE); } if (__predict_false(set_size < sizeof(fd_set))) { __fortify_fatal("%s: set size %zu is too small to be an fd_set", fn, set_size);