Commit Graph

130 Commits

Author SHA1 Message Date
sin
c51977cfcc Fix wcsrtombs() check 2015-03-04 20:16:44 +00:00
sin
4ddbe16d88 Fix mbsrtowcs() check 2015-03-04 19:58:48 +00:00
sin
7392bcaef8 Handle early termination in wcsnrtombs() and mbsnrtowcs() 2015-03-04 17:10:50 +00:00
sin
3d237352de Add wctomb() check 2015-03-04 13:12:58 +00:00
sin
911f402e94 Add wcstombs() check 2015-03-04 13:09:31 +00:00
sin
3532ee2caa Add wcsnrtombs() and wcsrtombs() checks 2015-03-04 12:59:41 +00:00
sin
ce3377dbb2 Add wcsncat() and wcsncpy() checks 2015-03-04 12:42:55 +00:00
sin
a28cd72ce6 Add wcrtomb(), wcscat() and wcscpy() checks 2015-03-04 12:27:04 +00:00
sin
316c87a6a6 Style fix 2015-03-03 20:38:52 +00:00
sin
95f63b3084 Add mbstowcs() check 2015-03-03 20:36:35 +00:00
sin
d548f4a37d Add mbsnrtowcs() and mbsrtowcs() checks 2015-03-03 20:30:47 +00:00
sin
f0efb87f8f Add wmemcpy() and wmemmove() checks 2015-03-03 18:16:29 +00:00
sin
a810ecae68 Add wmemset() check 2015-03-03 18:13:14 +00:00
sin
4514109df1 Fix signed/unsigned warning 2015-03-03 17:11:16 +00:00
sin
d87f9d94e1 Remove gcc attribute decoration 2015-03-03 17:10:34 +00:00
sin
1118911981 Don't trap on error for vsprintf() and friends 2015-03-03 17:00:06 +00:00
sin
2ced6e28c3 Add fgetws() check 2015-03-03 14:44:46 +00:00
sin
7279c33202 Add ppoll() check 2015-03-03 14:28:25 +00:00
sin
15c2b9d8df Add fwrite() check 2015-03-01 13:17:21 +00:00
sin
0c985218e9 Add fread() check 2015-03-01 13:12:09 +00:00
sin
488c3c7183 Add vsprintf() check 2015-03-01 12:10:40 +00:00
sin
66b34fbe59 Fix potential signed/unsigned warning 2015-03-01 11:55:38 +00:00
sin
0826c593be Add sprintf() check 2015-03-01 11:09:13 +00:00
sin
e71d1fd257 Remove redundant checks
We can never have an array of more than SIZE_MAX/2/sizeof(gid_t)
gid_t's.
2015-02-28 20:50:34 +00:00
sin
de499b92ba Minor style fix 2015-02-28 20:21:34 +00:00
sin
91db6f5899 Add sendto() check 2015-02-28 16:56:21 +00:00
sin
958ead636c Add readlink() and readlinkat() checks 2015-02-28 16:48:58 +00:00
sin
e02237241b Style fix 2015-02-28 16:11:32 +00:00
sin
7212959240 Use __typeof__(sizeof 0) trickery
We cannot pull stddef.h and since fortify already relies on GCC
features we can use the above typeof trick to get a usable size_t.
2015-02-28 16:01:26 +00:00
sin
4672406edd __fortify_realpath() should trap if PATH_MAX is not defined
This is currently done only if the pointer is non-NULL.
2015-02-28 15:59:52 +00:00
sin
33d2ff5aa8 Add ttyname_r() check 2015-02-28 15:30:25 +00:00
sin
2f0e3f574f Don't include stddef.h from poll.h 2015-02-28 14:52:09 +00:00
sin
2ea31ca96f Add poll() check
Not sure if including stddef.h from poll.h is acceptable.
2015-02-28 12:10:41 +00:00
sin
195fffa420 Add getgroups() check
Since getgroups() will never write more than NGROUPS_MAX entries
we might as well cap len to that value.

The following should probably not trap the program:

gid_t set[NGROUPS_MAX];
getgroups(NGROUPS_MAX + 1, set);
2015-02-28 12:00:25 +00:00
sin
60a7076816 Add getdomainname() check 2015-02-28 11:52:02 +00:00
sin
74ab284496 Clarify comment a bit 2015-02-25 10:35:16 +00:00
sin
816ad6764b Add getlogin_r() check 2015-02-25 10:31:30 +00:00
sin
d8afaf63d2 Add send() check 2015-02-24 19:37:25 +00:00
sin
eb7c60712c Add write() check 2015-02-24 19:34:37 +00:00
sin
f05c09fac8 Add realpath() check 2015-02-24 19:04:02 +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
9a77136c59 Add gethostname() checks 2015-02-23 10:45:20 +00:00
sin
c1734bf206 Remove header license comments 2015-02-22 09:39:43 +00:00
sin
00b376bb07 Add getcwd() checks 2015-02-05 14:07:14 +00:00
sin
aa19847d12 Add confstr() checks 2015-02-05 14:03:53 +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
91c0c1270f Add recvfrom() checks 2015-02-04 14:58:32 +00:00
sin
aa095b6d52 Add recv() checks 2015-01-30 16:43:36 +00:00
sin
6f0d1a1b6f Use consistent naming convention 2015-01-30 16:40:01 +00:00
sin
6156f7de8b Remove pwrite/write 2015-01-30 16:37:07 +00:00
sin
e4fe187649 Remove __restrict 2015-01-30 16:25:13 +00:00
sin
e6837a7874 Add FD_{CLR,SET} checks 2015-01-30 16:17:31 +00:00
sin
03886aa26c Add pread() and pwrite() checks 2015-01-30 09:44:49 +00:00
sin
03289c3954 Fix typo 2015-01-29 20:41:17 +00:00
sin
131211ad47 Style fix 2015-01-29 20:34:01 +00:00
sin
647c25ad9c Add read()/write() checks 2015-01-29 20:31:49 +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
3effc6dace Style fix 2015-01-29 12:14:44 +00:00
sin
4a18008ce1 Add bzero() checks 2015-01-29 12:14:06 +00:00
sin
3d15948020 Add license info 2015-01-29 11:13:07 +00:00
sin
c18ebb0399 Style fix 2015-01-29 11:10:04 +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
52d4c97980 Add bcopy() checks 2015-01-29 10:43:09 +00:00
sin
2f6dc9f34f Add fgets() checks 2015-01-29 00:12:59 +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
31f2952bc7 Use local _n to avoid multiple evaluation 2015-01-28 17:15:56 +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
5960e3364f Add snprintf() checks
We need to use a variadic macro in this case because GCC doesn't
allow inline functions with variable argument lists.
2015-01-28 17:08:37 +00:00
sin
b4a9df1a08 Use __builtin_va_list 2015-01-28 16:57:38 +00:00
sin
e2a76a9502 Add vsnprintf() checks 2015-01-28 16:54:48 +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