blob: fc2ccf894837dc457b27950b88ccb92c8a29614f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#define _GNU_SOURCE
#include <sys/cdefs.h>
#include <ssp/ssp.h>
#include <string.h>
#undef mempcpy
void *__mempcpy_chk(void * __restrict, const void * __restrict, size_t, size_t);
void *
__mempcpy_chk(void * __restrict dst, const void * __restrict src, size_t len,
size_t slen)
{
if (len > slen)
__chk_fail();
if (__ssp_overlap((const char *)src, (const char *)dst, len))
__chk_fail();
return mempcpy(dst, src, len);
}
|