Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/include/ssp add a macro to check overlapping pointers



details:   https://anonhg.NetBSD.org/src/rev/df38838f18eb
branches:  trunk
changeset: 808202:df38838f18eb
user:      christos <christos%NetBSD.org@localhost>
date:      Sat May 09 15:41:47 2015 +0000

description:
add a macro to check overlapping pointers

diffstat:

 include/ssp/ssp.h |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (19 lines):

diff -r 31a7fa890991 -r df38838f18eb include/ssp/ssp.h
--- a/include/ssp/ssp.h Sat May 09 15:36:15 2015 +0000
+++ b/include/ssp/ssp.h Sat May 09 15:41:47 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ssp.h,v 1.10 2012/08/08 20:23:32 joerg Exp $   */
+/*     $NetBSD: ssp.h,v 1.11 2015/05/09 15:41:47 christos Exp $        */
 
 /*-
  * Copyright (c) 2006, 2011 The NetBSD Foundation, Inc.
@@ -77,6 +77,9 @@
 #define __ssp_redirect0(rtype, fun, args, call) \
     __ssp_redirect_raw(rtype, fun, fun, args, call, __ssp_bos0)
 
+#define __ssp_overlap(a, b, l) \
+    (((a) <= (b) && (b) <= (a) + (l)) || ((b) <= (a) && (a) <= (b) + (l)))
+
 __BEGIN_DECLS
 void __stack_chk_fail(void) __dead;
 void __chk_fail(void) __dead;



Home | Main Index | Thread Index | Old Index