summaryrefslogtreecommitdiff
path: root/include/string.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/string.h')
-rw-r--r--include/string.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/string.h b/include/string.h
index 9fc1cd4..cf0be60 100644
--- a/include/string.h
+++ b/include/string.h
@@ -37,6 +37,8 @@ extern "C" {
37#undef strncat 37#undef strncat
38#undef strncpy 38#undef strncpy
39 39
40__access(write_only, 1, 3)
41__access(read_only, 2, 3)
40_FORTIFY_FN(memcpy) void *memcpy(void * _FORTIFY_POS0 __od, 42_FORTIFY_FN(memcpy) void *memcpy(void * _FORTIFY_POS0 __od,
41 const void * _FORTIFY_POS0 __os, size_t __n) 43 const void * _FORTIFY_POS0 __os, size_t __n)
42{ 44{
@@ -55,6 +57,8 @@ _FORTIFY_FN(memcpy) void *memcpy(void * _FORTIFY_POS0 __od,
55 return __builtin_memcpy(__od, __os, __n); 57 return __builtin_memcpy(__od, __os, __n);
56} 58}
57 59
60__access(write_only, 1, 3)
61__access(read_only, 2, 3)
58_FORTIFY_FN(memmove) void *memmove(void * _FORTIFY_POS0 __d, 62_FORTIFY_FN(memmove) void *memmove(void * _FORTIFY_POS0 __d,
59 const void * _FORTIFY_POS0 __s, size_t __n) 63 const void * _FORTIFY_POS0 __s, size_t __n)
60{ 64{
@@ -66,6 +70,7 @@ _FORTIFY_FN(memmove) void *memmove(void * _FORTIFY_POS0 __d,
66 return __orig_memmove(__d, __s, __n); 70 return __orig_memmove(__d, __s, __n);
67} 71}
68 72
73__access(write_only, 1, 3)
69_FORTIFY_FN(memset) void *memset(void * _FORTIFY_POS0 __d, int __c, size_t __n) 74_FORTIFY_FN(memset) void *memset(void * _FORTIFY_POS0 __d, int __c, size_t __n)
70{ 75{
71 size_t __b = __bos(__d, 0); 76 size_t __b = __bos(__d, 0);
@@ -79,6 +84,8 @@ _FORTIFY_FN(memset) void *memset(void * _FORTIFY_POS0 __d, int __c, size_t __n)
79 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ 84 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
80 || defined(_BSD_SOURCE) 85 || defined(_BSD_SOURCE)
81#undef stpcpy 86#undef stpcpy
87__access(write_only, 1)
88__access(read_only, 2)
82_FORTIFY_FN(stpcpy) char *stpcpy(char * _FORTIFY_POS0 __d, const char *__s) 89_FORTIFY_FN(stpcpy) char *stpcpy(char * _FORTIFY_POS0 __d, const char *__s)
83{ 90{
84 size_t __b = __bos(__d, 0); 91 size_t __b = __bos(__d, 0);
@@ -89,6 +96,8 @@ _FORTIFY_FN(stpcpy) char *stpcpy(char * _FORTIFY_POS0 __d, const char *__s)
89} 96}
90 97
91#undef stpncpy 98#undef stpncpy
99__access(write_only, 1)
100__access(read_only, 2)
92_FORTIFY_FN(stpncpy) char *stpncpy(char * _FORTIFY_POS0 __d, const char *__s, 101_FORTIFY_FN(stpncpy) char *stpncpy(char * _FORTIFY_POS0 __d, const char *__s,
93 size_t __n) 102 size_t __n)
94{ 103{
@@ -100,6 +109,8 @@ _FORTIFY_FN(stpncpy) char *stpncpy(char * _FORTIFY_POS0 __d, const char *__s,
100} 109}
101#endif 110#endif
102 111
112__access(read_write, 1)
113__access(read_only, 2)
103_FORTIFY_FN(strcat) char *strcat(char * _FORTIFY_POS0 __d, const char *__s) 114_FORTIFY_FN(strcat) char *strcat(char * _FORTIFY_POS0 __d, const char *__s)
104{ 115{
105 size_t __b = __bos(__d, 0); 116 size_t __b = __bos(__d, 0);
@@ -109,6 +120,8 @@ _FORTIFY_FN(strcat) char *strcat(char * _FORTIFY_POS0 __d, const char *__s)
109 return __orig_strcat(__d, __s); 120 return __orig_strcat(__d, __s);
110} 121}
111 122
123__access(write_only, 1)
124__access(read_only, 2)
112_FORTIFY_FN(strcpy) char *strcpy(char * _FORTIFY_POS0 __d, const char *__s) 125_FORTIFY_FN(strcpy) char *strcpy(char * _FORTIFY_POS0 __d, const char *__s)
113{ 126{
114 size_t __b = __bos(__d, 0); 127 size_t __b = __bos(__d, 0);
@@ -118,6 +131,8 @@ _FORTIFY_FN(strcpy) char *strcpy(char * _FORTIFY_POS0 __d, const char *__s)
118 return __orig_strcpy(__d, __s); 131 return __orig_strcpy(__d, __s);
119} 132}
120 133
134__access(read_write, 1)
135__access(read_only, 2)
121_FORTIFY_FN(strncat) char *strncat(char * _FORTIFY_POS0 __d, const char *__s, 136_FORTIFY_FN(strncat) char *strncat(char * _FORTIFY_POS0 __d, const char *__s,
122 size_t __n) 137 size_t __n)
123{ 138{
@@ -135,6 +150,8 @@ _FORTIFY_FN(strncat) char *strncat(char * _FORTIFY_POS0 __d, const char *__s,
135 return __orig_strncat(__d, __s, __n); 150 return __orig_strncat(__d, __s, __n);
136} 151}
137 152
153__access(write_only, 1)
154__access(read_only, 2)
138_FORTIFY_FN(strncpy) char *strncpy(char * _FORTIFY_POS0 __d, 155_FORTIFY_FN(strncpy) char *strncpy(char * _FORTIFY_POS0 __d,
139 const char *__s, size_t __n) 156 const char *__s, size_t __n)
140{ 157{
@@ -147,6 +164,8 @@ _FORTIFY_FN(strncpy) char *strncpy(char * _FORTIFY_POS0 __d,
147 164
148#ifdef _GNU_SOURCE 165#ifdef _GNU_SOURCE
149#undef mempcpy 166#undef mempcpy
167__access(write_only, 1, 3)
168__access(read_only, 2, 3)
150_FORTIFY_FN(mempcpy) void *mempcpy(void * _FORTIFY_POS0 __d, 169_FORTIFY_FN(mempcpy) void *mempcpy(void * _FORTIFY_POS0 __d,
151 const void * _FORTIFY_POS0 __s, size_t __n) 170 const void * _FORTIFY_POS0 __s, size_t __n)
152{ 171{
@@ -162,6 +181,8 @@ _FORTIFY_FN(mempcpy) void *mempcpy(void * _FORTIFY_POS0 __d,
162#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 181#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
163#undef strlcat 182#undef strlcat
164#undef strlcpy 183#undef strlcpy
184__access(read_write, 1)
185__access(read_only, 2)
165_FORTIFY_FN(strlcat) size_t strlcat(char * _FORTIFY_POS0 __d, 186_FORTIFY_FN(strlcat) size_t strlcat(char * _FORTIFY_POS0 __d,
166 const char *__s, size_t __n) 187 const char *__s, size_t __n)
167{ 188{
@@ -172,6 +193,8 @@ _FORTIFY_FN(strlcat) size_t strlcat(char * _FORTIFY_POS0 __d,
172 return __orig_strlcat(__d, __s, __n); 193 return __orig_strlcat(__d, __s, __n);
173} 194}
174 195
196__access(write_only, 1)
197__access(read_only, 2)
175_FORTIFY_FN(strlcpy) size_t strlcpy(char * _FORTIFY_POS0 __d, 198_FORTIFY_FN(strlcpy) size_t strlcpy(char * _FORTIFY_POS0 __d,
176 const char *__s, size_t __n) 199 const char *__s, size_t __n)
177{ 200{