Module Name: src
Committed By: christos
Date: Tue Jan 25 19:13:45 UTC 2011
Modified Files:
src/include/ssp: ssp.h
Log Message:
proved an __ssp_check macro.
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/include/ssp/ssp.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/include/ssp/ssp.h
diff -u src/include/ssp/ssp.h:1.6 src/include/ssp/ssp.h:1.7
--- src/include/ssp/ssp.h:1.6 Wed Jan 19 21:58:17 2011
+++ src/include/ssp/ssp.h Tue Jan 25 14:13:44 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: ssp.h,v 1.6 2011/01/20 02:58:17 christos Exp $ */
+/* $NetBSD: ssp.h,v 1.7 2011/01/25 19:13:44 christos Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -54,12 +54,14 @@
#define __ssp_bos(ptr) __builtin_object_size(ptr, __SSP_FORTIFY_LEVEL > 1)
#define __ssp_bos0(ptr) __builtin_object_size(ptr, 0)
+#define __ssp_check(buf, len, bos) \
+ if (bos(buf) != (size_t)-1 && len > bos(buf)) \
+ __chk_fail()
#define __ssp_redirect_raw(rtype, fun, args, call, bos) \
rtype __ssp_weak_name(fun) args; \
__ssp_inline rtype fun args; \
__ssp_inline rtype fun args { \
- if (bos(__buf) != (size_t)-1 && __len > bos(__buf)) \
- __chk_fail(); \
+ __ssp_check(__buf, __len, bos); \
return __ssp_weak_name(fun) call; \
}