mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-26 10:53:39 +01:00
include: ssp: fix the build with earlier C standards
`inline` isn't always a keyword, so we should be using __ssp_inline as we do everywhere else in the _FORTIFY_SOURCE support. Variable declarations in a loop initializer are also not always supported, so declare any loop vars in advance. Reviewed by: kib (earlier version), markj Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D45976
This commit is contained in:
parent
838b6caaba
commit
b8730c11a3
@ -101,11 +101,12 @@ __ssp_redirect_raw_impl(ssize_t, recvmmsg, recvmmsg,
|
|||||||
const struct timespec *__restrict timeout))
|
const struct timespec *__restrict timeout))
|
||||||
{
|
{
|
||||||
const size_t vecsz = __ssp_bos(hdrvec);
|
const size_t vecsz = __ssp_bos(hdrvec);
|
||||||
|
size_t i;
|
||||||
|
|
||||||
if (vecsz != (size_t)-1 && vecsz / sizeof(*hdrvec) < vlen)
|
if (vecsz != (size_t)-1 && vecsz / sizeof(*hdrvec) < vlen)
|
||||||
__chk_fail();
|
__chk_fail();
|
||||||
|
|
||||||
for (size_t i = 0; i < vlen; i++) {
|
for (i = 0; i < vlen; i++) {
|
||||||
__ssp_check_msghdr(&hdrvec[i].msg_hdr);
|
__ssp_check_msghdr(&hdrvec[i].msg_hdr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ __ssp_redirect_raw_impl(rtype, fun, symbol, args) { \
|
|||||||
|
|
||||||
#include <machine/_stdint.h>
|
#include <machine/_stdint.h>
|
||||||
|
|
||||||
static inline int
|
__ssp_inline int
|
||||||
__ssp_overlap(const void *leftp, const void *rightp, __size_t sz)
|
__ssp_overlap(const void *leftp, const void *rightp, __size_t sz)
|
||||||
{
|
{
|
||||||
__uintptr_t left = (__uintptr_t)leftp;
|
__uintptr_t left = (__uintptr_t)leftp;
|
||||||
@ -112,11 +112,12 @@ __ssp_inline void
|
|||||||
__ssp_check_iovec(const struct iovec *iov, int iovcnt)
|
__ssp_check_iovec(const struct iovec *iov, int iovcnt)
|
||||||
{
|
{
|
||||||
const size_t iovsz = __ssp_bos(iov);
|
const size_t iovsz = __ssp_bos(iov);
|
||||||
|
int i;
|
||||||
|
|
||||||
if (iovsz != (size_t)-1 && iovsz / sizeof(*iov) < (size_t)iovcnt)
|
if (iovsz != (size_t)-1 && iovsz / sizeof(*iov) < (size_t)iovcnt)
|
||||||
__chk_fail();
|
__chk_fail();
|
||||||
|
|
||||||
for (int i = 0; i < iovcnt; i++) {
|
for (i = 0; i < iovcnt; i++) {
|
||||||
if (__ssp_bos(iov[i].iov_base) < iov[i].iov_len)
|
if (__ssp_bos(iov[i].iov_base) < iov[i].iov_len)
|
||||||
__chk_fail();
|
__chk_fail();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user