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
This commit is contained in:
Narayan Kamath 2018-03-14 12:37:25 +00:00
parent 35e620cf98
commit 38e960b7aa
1 changed files with 1 additions and 1 deletions

View File

@ -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);