[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#408596: preprocessor symbols _FORTIFY_SOURCE and __USE_FORTIFY_LEVEL used but not defined



Package: libc6-dev
Version: 2.3.6.ds1-10
Severity: normal

Several headers in glibc use the preprocessor symbols _FORTIFY_SOURCE and
__USE_FORTIFY_LEVEL in #if conditionals without ensuring that they have a
definition.

>From /usr/include/features.h:

#if _FORTIFY_SOURCE > 0 && __GNUC_PREREQ (4, 1) && __OPTIMIZE__ > 0
# if _FORTIFY_SOURCE == 1
#  define __USE_FORTIFY_LEVEL 1
# elif _FORTIFY_SOURCE > 1
#  define __USE_FORTIFY_LEVEL 2
# endif
#endif

>From /usr/include/stdio.h:

#if __USE_FORTIFY_LEVEL > 0 && !defined __cplusplus
# include <bits/stdio2.h>
#endif

>From /usr/include/string.h:

# if __USE_FORTIFY_LEVEL > 0 && !defined __cplusplus
/* Functions with security checks.  */
#  include <bits/string3.h>
# endif
#endif

Each of these should get wrapped in an #ifdef on the corresponding symbol, to
avoid referencing the value of an undefined preprocessor symbol.

- Josh Triplett



Reply to: