diff options
| -rw-r--r-- | include/ssp/ssp.h | 11 | ||||
| -rw-r--r-- | include/ssp/unistd.h | 5 |
2 files changed, 9 insertions, 7 deletions
diff --git a/include/ssp/ssp.h b/include/ssp/ssp.h index b0c0c3310f7..12a5ec076e5 100644 --- a/include/ssp/ssp.h +++ b/include/ssp/ssp.h @@ -1,4 +1,4 @@ -/* $NetBSD: ssp.h,v 1.11 2015/05/09 15:41:47 christos Exp $ */ +/* $NetBSD: ssp.h,v 1.12 2015/06/25 18:41:03 joerg Exp $ */ /*- * Copyright (c) 2006, 2011 The NetBSD Foundation, Inc. @@ -64,18 +64,19 @@ #define __ssp_check(buf, len, bos) \ if (bos(buf) != (size_t)-1 && len > bos(buf)) \ __chk_fail() -#define __ssp_redirect_raw(rtype, fun, symbol, args, call, bos) \ +#define __ssp_redirect_raw(rtype, fun, symbol, args, call, cond, bos) \ rtype __ssp_real_(fun) args __RENAME(symbol); \ __ssp_inline rtype fun args __RENAME(__ssp_protected_ ## fun); \ __ssp_inline rtype fun args { \ - __ssp_check(__buf, __len, bos); \ + if (cond) \ + __ssp_check(__buf, __len, bos); \ return __ssp_real_(fun) call; \ } #define __ssp_redirect(rtype, fun, args, call) \ - __ssp_redirect_raw(rtype, fun, fun, args, call, __ssp_bos) + __ssp_redirect_raw(rtype, fun, fun, args, call, 1, __ssp_bos) #define __ssp_redirect0(rtype, fun, args, call) \ - __ssp_redirect_raw(rtype, fun, fun, args, call, __ssp_bos0) + __ssp_redirect_raw(rtype, fun, fun, args, call, 1, __ssp_bos0) #define __ssp_overlap(a, b, l) \ (((a) <= (b) && (b) <= (a) + (l)) || ((b) <= (a) && (a) <= (b) + (l))) diff --git a/include/ssp/unistd.h b/include/ssp/unistd.h index 1d707960919..e5089364e76 100644 --- a/include/ssp/unistd.h +++ b/include/ssp/unistd.h @@ -1,4 +1,4 @@ -/* $NetBSD: unistd.h,v 1.6 2011/01/26 18:07:44 christos Exp $ */ +/* $NetBSD: unistd.h,v 1.7 2015/06/25 18:41:03 joerg Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -42,7 +42,8 @@ __ssp_redirect0(ssize_t, read, (int __fd, void *__buf, size_t __len), \ __ssp_redirect(ssize_t, readlink, (const char *__restrict __path, \ char *__restrict __buf, size_t __len), (__path, __buf, __len)); -__ssp_redirect(char *, getcwd, (char *__buf, size_t __len), (__buf, __len)); +__ssp_redirect_raw(char *, getcwd, getcwd, (char *__buf, size_t __len), + (__buf, __len), __buf != 0, __ssp_bos); __END_DECLS |
