#ifndef os
|
#ifndef os
|
# define os(ptr) __builtin_object_size (ptr, 0)
|
# define os(ptr) __builtin_object_size (ptr, 0)
|
#endif
|
#endif
|
|
|
/* This is one of the alternatives for object size checking.
|
/* This is one of the alternatives for object size checking.
|
If dst has side-effects, size checking will never be done. */
|
If dst has side-effects, size checking will never be done. */
|
#undef memcpy
|
#undef memcpy
|
#define memcpy(dst, src, len) \
|
#define memcpy(dst, src, len) \
|
__builtin___memcpy_chk (dst, src, len, os (dst))
|
__builtin___memcpy_chk (dst, src, len, os (dst))
|
#undef mempcpy
|
#undef mempcpy
|
#define mempcpy(dst, src, len) \
|
#define mempcpy(dst, src, len) \
|
__builtin___mempcpy_chk (dst, src, len, os (dst))
|
__builtin___mempcpy_chk (dst, src, len, os (dst))
|
#undef memmove
|
#undef memmove
|
#define memmove(dst, src, len) \
|
#define memmove(dst, src, len) \
|
__builtin___memmove_chk (dst, src, len, os (dst))
|
__builtin___memmove_chk (dst, src, len, os (dst))
|
#undef memset
|
#undef memset
|
#define memset(dst, val, len) \
|
#define memset(dst, val, len) \
|
__builtin___memset_chk (dst, val, len, os (dst))
|
__builtin___memset_chk (dst, val, len, os (dst))
|
#undef strcpy
|
#undef strcpy
|
#define strcpy(dst, src) \
|
#define strcpy(dst, src) \
|
__builtin___strcpy_chk (dst, src, os (dst))
|
__builtin___strcpy_chk (dst, src, os (dst))
|
#undef stpcpy
|
#undef stpcpy
|
#define stpcpy(dst, src) \
|
#define stpcpy(dst, src) \
|
__builtin___stpcpy_chk (dst, src, os (dst))
|
__builtin___stpcpy_chk (dst, src, os (dst))
|
#undef strcat
|
#undef strcat
|
#define strcat(dst, src) \
|
#define strcat(dst, src) \
|
__builtin___strcat_chk (dst, src, os (dst))
|
__builtin___strcat_chk (dst, src, os (dst))
|
#undef strncpy
|
#undef strncpy
|
#define strncpy(dst, src, len) \
|
#define strncpy(dst, src, len) \
|
__builtin___strncpy_chk (dst, src, len, os (dst))
|
__builtin___strncpy_chk (dst, src, len, os (dst))
|
#undef strncat
|
#undef strncat
|
#define strncat(dst, src, len) \
|
#define strncat(dst, src, len) \
|
__builtin___strncat_chk (dst, src, len, os (dst))
|
__builtin___strncat_chk (dst, src, len, os (dst))
|
#undef sprintf
|
#undef sprintf
|
#define sprintf(dst, ...) \
|
#define sprintf(dst, ...) \
|
__builtin___sprintf_chk (dst, 0, os (dst), __VA_ARGS__)
|
__builtin___sprintf_chk (dst, 0, os (dst), __VA_ARGS__)
|
#undef vsprintf
|
#undef vsprintf
|
#define vsprintf(dst, fmt, ap) \
|
#define vsprintf(dst, fmt, ap) \
|
__builtin___vsprintf_chk (dst, 0, os (dst), fmt, ap)
|
__builtin___vsprintf_chk (dst, 0, os (dst), fmt, ap)
|
#undef snprintf
|
#undef snprintf
|
#define snprintf(dst, len, ...) \
|
#define snprintf(dst, len, ...) \
|
__builtin___snprintf_chk (dst, len, 0, os (dst), __VA_ARGS__)
|
__builtin___snprintf_chk (dst, len, 0, os (dst), __VA_ARGS__)
|
#undef vsnprintf
|
#undef vsnprintf
|
#define vsnprintf(dst, len, fmt, ap) \
|
#define vsnprintf(dst, len, fmt, ap) \
|
__builtin___vsnprintf_chk (dst, len, 0, os (dst), fmt, ap)
|
__builtin___vsnprintf_chk (dst, len, 0, os (dst), fmt, ap)
|
|
|
/* Now "redefine" even builtins for the purpose of testing. */
|
/* Now "redefine" even builtins for the purpose of testing. */
|
#undef __builtin_memcpy
|
#undef __builtin_memcpy
|
#define __builtin_memcpy(dst, src, len) memcpy (dst, src, len)
|
#define __builtin_memcpy(dst, src, len) memcpy (dst, src, len)
|
#undef __builtin_mempcpy
|
#undef __builtin_mempcpy
|
#define __builtin_mempcpy(dst, src, len) mempcpy (dst, src, len)
|
#define __builtin_mempcpy(dst, src, len) mempcpy (dst, src, len)
|
#undef __builtin_memmove
|
#undef __builtin_memmove
|
#define __builtin_memmove(dst, src, len) memmove (dst, src, len)
|
#define __builtin_memmove(dst, src, len) memmove (dst, src, len)
|
#undef __builtin_memset
|
#undef __builtin_memset
|
#define __builtin_memset(dst, val, len) memset (dst, val, len)
|
#define __builtin_memset(dst, val, len) memset (dst, val, len)
|
#undef __builtin_strcpy
|
#undef __builtin_strcpy
|
#define __builtin_strcpy(dst, src) strcpy (dst, src)
|
#define __builtin_strcpy(dst, src) strcpy (dst, src)
|
#undef __builtin_stpcpy
|
#undef __builtin_stpcpy
|
#define __builtin_stpcpy(dst, src) stpcpy (dst, src)
|
#define __builtin_stpcpy(dst, src) stpcpy (dst, src)
|
#undef __builtin_strcat
|
#undef __builtin_strcat
|
#define __builtin_strcat(dst, src) strcat (dst, src)
|
#define __builtin_strcat(dst, src) strcat (dst, src)
|
#undef __builtin_strncpy
|
#undef __builtin_strncpy
|
#define __builtin_strncpy(dst, src, len) strncpy (dst, src, len)
|
#define __builtin_strncpy(dst, src, len) strncpy (dst, src, len)
|
#undef __builtin_strncat
|
#undef __builtin_strncat
|
#define __builtin_strncat(dst, src, len) strncat (dst, src, len)
|
#define __builtin_strncat(dst, src, len) strncat (dst, src, len)
|
#undef __builtin_sprintf
|
#undef __builtin_sprintf
|
#define __builtin_sprintf(dst, ...) sprintf (dst, __VA_ARGS__)
|
#define __builtin_sprintf(dst, ...) sprintf (dst, __VA_ARGS__)
|
#undef __builtin_vsprintf
|
#undef __builtin_vsprintf
|
#define __builtin_vsprintf(dst, fmt, ap) vsprintf (dst, fmt, ap)
|
#define __builtin_vsprintf(dst, fmt, ap) vsprintf (dst, fmt, ap)
|
#undef __builtin_snprintf
|
#undef __builtin_snprintf
|
#define __builtin_snprintf(dst, len, ...) snprintf (dst, len, __VA_ARGS__)
|
#define __builtin_snprintf(dst, len, ...) snprintf (dst, len, __VA_ARGS__)
|
#undef __builtin_vsnprintf
|
#undef __builtin_vsnprintf
|
#define __builtin_vsnprintf(dst, len, fmt, ap) vsnprintf (dst, len, fmt, ap)
|
#define __builtin_vsnprintf(dst, len, fmt, ap) vsnprintf (dst, len, fmt, ap)
|
|
|
extern void *chk_fail_buf[];
|
extern void *chk_fail_buf[];
|
extern volatile int chk_fail_allowed, chk_calls;
|
extern volatile int chk_fail_allowed, chk_calls;
|
extern volatile int memcpy_disallowed, mempcpy_disallowed, memmove_disallowed;
|
extern volatile int memcpy_disallowed, mempcpy_disallowed, memmove_disallowed;
|
extern volatile int memset_disallowed, strcpy_disallowed, stpcpy_disallowed;
|
extern volatile int memset_disallowed, strcpy_disallowed, stpcpy_disallowed;
|
extern volatile int strncpy_disallowed, strcat_disallowed, strncat_disallowed;
|
extern volatile int strncpy_disallowed, strcat_disallowed, strncat_disallowed;
|
extern volatile int sprintf_disallowed, vsprintf_disallowed;
|
extern volatile int sprintf_disallowed, vsprintf_disallowed;
|
extern volatile int snprintf_disallowed, vsnprintf_disallowed;
|
extern volatile int snprintf_disallowed, vsnprintf_disallowed;
|
|
|