Commit Graph

26 Commits

Author SHA1 Message Date
sin
8604f138c5 Add ifdef guards for C++ code 2015-03-11 09:26:11 +00:00
sin
1fbf7a3a5e Add explicit casts to satisfy C++ code 2015-03-11 09:21:25 +00:00
sin
499ea65dd5 Revert "Fix invalid conversion in C++ code"
This reverts commit 4b4dfea25d660a8a27e95ea531686001246b3d1e.
2015-03-11 09:21:00 +00:00
sin
4b4dfea25d Fix invalid conversion in C++ code
/usr/include/fortify/string.h: In function 'void* __fortify_memcpy(void*, const void*, size_t)':
/usr/include/fortify/string.h:13:12: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
/usr/include/fortify/string.h:14:18: error: invalid conversion from 'const void*' to 'const char*' [-fpermissive]

Since we are relying on GCC anyway, assume void * arithmetic is OK.
2015-03-11 09:17:56 +00:00
sin
701d7d3303 Fix strncat() and strncpy() mappings
Thanks zhasha.
2015-03-10 16:38:26 +00:00
sin
74ab284496 Clarify comment a bit 2015-02-25 10:35:16 +00:00
sin
eecef18261 Remove compile time checks
These can produce false positives.  Given that we support fortify
source level 1 we shouldn't break valid code.
2015-02-24 18:14:33 +00:00
sin
c1734bf206 Remove header license comments 2015-02-22 09:39:43 +00:00
sin
6e4f53a3f5 Remember to #undef __errordecl
Thanks zhasha for spotting this.
2015-02-04 18:06:57 +00:00
sin
87f56f70d7 Style fix 2015-02-04 15:13:38 +00:00
sin
e4fe187649 Remove __restrict 2015-01-30 16:25:13 +00:00
sin
03289c3954 Fix typo 2015-01-29 20:41:17 +00:00
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