OpenCoverage

kludge-fd_set.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssh/src/openbsd-compat/kludge-fd_set.c
Source codeSwitch to Preprocessed file
LineSourceCount
1/* Placed in the public domain. */-
2-
3/*-
4 * _FORTIFY_SOURCE includes a misguided check for FD_SET(n)/FD_ISSET(b)-
5 * where n > FD_SETSIZE. This breaks OpenSSH and other programs that-
6 * explicitly allocate fd_sets. To avoid this, we wrap FD_SET in a-
7 * function compiled without _FORTIFY_SOURCE.-
8 */-
9-
10#include "config.h"-
11-
12#if defined(HAVE_FEATURES_H) && defined(_FORTIFY_SOURCE)-
13# include <features.h>-
14# if defined(__GNU_LIBRARY__) && defined(__GLIBC_PREREQ)-
15# if __GLIBC_PREREQ(2, 15) && (_FORTIFY_SOURCE > 0)-
16# undef _FORTIFY_SOURCE-
17# undef __USE_FORTIFY_LEVEL-
18# include <sys/socket.h>-
19void kludge_FD_SET(int n, fd_set *set) {-
20 FD_SET(n, set);-
21}
never executed: end of block
0
22int kludge_FD_ISSET(int n, fd_set *set) {-
23 return FD_ISSET(n, set);
never executed: return (((( set )->fds_bits)[(( n ) / (8 * (int) sizeof (__fd_mask)))] & ((__fd_mask) (1UL << (( n ) % (8 * (int) sizeof (__fd_mask)))))) != 0) ;
0
24}-
25# endif /* __GLIBC_PREREQ(2, 15) && (_FORTIFY_SOURCE > 0) */-
26# endif /* __GNU_LIBRARY__ && __GLIBC_PREREQ */-
27#endif /* HAVE_FEATURES_H && _FORTIFY_SOURCE */-
28-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.2