Commit Graph

14 Commits

Author SHA1 Message Date
sin
0784beab02 Allow dest == src in memcpy()
memcpy() needs to accept dest == src for gcc.
struct foo a, b; a = a; might be implemented using memcpy().
2015-01-29 17:55:03 +00:00
sin
474f2887ce Add compile-time checks as well 2015-01-29 12:42:41 +00:00
sin
3d15948020 Add license info 2015-01-29 11:13:07 +00:00
sin
1e306fd642 Trap if memcpy() pointers are overlapping
Maybe this should only be done if _FORTIFY_SOURCE > 1.
2015-01-29 10:56:15 +00:00
sin
f54195479d Use BSD-style func defs 2015-01-28 23:40:17 +00:00
sin
37b438f146 Use #ifdef instead of #if defined 2015-01-28 17:47:08 +00:00
sin
c49f6215ea Add mempcpy() checks 2015-01-28 17:44:38 +00:00
sin
bcc398c14a Simplify checks
Do not perform checks only when `n' is constant, most of the time
it is not.

The bos == (size_t)-1 check is redundant because n > bos
with bos == -1 will always be false.
2015-01-28 17:13:44 +00:00
sin
1872b6a7e5 Remove trailing semicolon 2015-01-28 16:31:19 +00:00
sin
013d07a11c Add stpncpy() 2015-01-28 16:21:38 +00:00
sin
9626051b5d Add stpcpy() 2015-01-28 16:16:23 +00:00
sin
de7999ee82 Move defines to the bottom
This allows us to re-use the functions internally.
2015-01-28 16:07:24 +00:00
sin
6bb34c15b4 Merge __foo_chk() into __fortify_foo() 2015-01-28 15:39:11 +00:00
sin
b258495eba Initial commit 2015-01-28 15:14:49 +00:00