Add wmemset() check
This commit is contained in:
parent
4514109df1
commit
a810ecae68
@ -16,8 +16,21 @@ __fortify_fgetws(wchar_t *s, int n, FILE *fp)
|
|||||||
return fgetws(s, n, fp);
|
return fgetws(s, n, fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline __attribute__ ((always_inline))
|
||||||
|
wchar_t *
|
||||||
|
__fortify_wmemset(wchar_t *s, wchar_t c, size_t n)
|
||||||
|
{
|
||||||
|
size_t bos = __builtin_object_size(s, 0);
|
||||||
|
|
||||||
|
if (n > bos / sizeof(wchar_t))
|
||||||
|
__builtin_trap();
|
||||||
|
return wmemset(s, c, n);
|
||||||
|
}
|
||||||
|
|
||||||
#undef fgetws
|
#undef fgetws
|
||||||
#define fgetws(s, n, fp) __fortify_fgetws(s, n, fp)
|
#define fgetws(s, n, fp) __fortify_fgetws(s, n, fp)
|
||||||
|
#undef wmemset
|
||||||
|
#define wmemset(s, c, n) __fortify_wmemset(s, c, n)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user