From 8513fddefca4c6e3982718732afeec71bad4e688 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Wed, 27 Dec 2023 16:17:55 +0100 Subject: Improve __fh_overlap implementation --- include/fortify-headers.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/fortify-headers.h') diff --git a/include/fortify-headers.h b/include/fortify-headers.h index 9831a33..d75ff43 100644 --- a/include/fortify-headers.h +++ b/include/fortify-headers.h @@ -135,10 +135,10 @@ //TODO(jvoisin) Add a check for overflows /* check if pointers are overlapping but not if dst == src, * since gcc seems to like to generate code that relies on dst == src */ -#define __fh_overlap(a, b, l) \ +#define __fh_overlap(a, len_a, b, len_b) \ ( \ - ((a) < (b) && (b) < (a) + (__fh_size_t)(l)) \ - || ((b) < (a) && (a) < (b) + (__fh_size_t)(l)) \ + ((a) < (b) && (b) < (a) + (__fh_size_t)(len_a)) \ + || ((b) < (a) && (a) < (b) + (__fh_size_t)(len_b)) \ ) /* -- cgit v1.3