diff options
author | 2004-06-21 22:55:04 +0000 | |
---|---|---|
committer | 2004-06-21 22:55:04 +0000 | |
commit | b857d3eaea8668342fb8839a06a7134895bd62d7 (patch) | |
tree | 1ebfd2f50010b3a06c1d3884a9a8baf391292135 | |
parent | document sort options (diff) | |
download | wireguard-openbsd-b857d3eaea8668342fb8839a06a7134895bd62d7.tar.xz wireguard-openbsd-b857d3eaea8668342fb8839a06a7134895bd62d7.zip |
add bounded attribute to some functions. anil tested and ok'ed
-rw-r--r-- | sys/lib/libkern/funcs.h | 6 | ||||
-rw-r--r-- | sys/lib/libkern/libkern.h | 11 |
2 files changed, 11 insertions, 6 deletions
diff --git a/sys/lib/libkern/funcs.h b/sys/lib/libkern/funcs.h index 9312dfb7d8a..b2cd0692f53 100644 --- a/sys/lib/libkern/funcs.h +++ b/sys/lib/libkern/funcs.h @@ -1,2 +1,4 @@ -size_t strlcpy(char *, const char *, int); -size_t strlcat(char *, const char *, int); +size_t strlcpy(char *, const char *, int) + __attribute__ ((__bounded__(__string__,1,3))); +size_t strlcat(char *, const char *, int) + __attribute__ ((__bounded__(__string__,1,3))); diff --git a/sys/lib/libkern/libkern.h b/sys/lib/libkern/libkern.h index 1acf6bf8775..ef16334295b 100644 --- a/sys/lib/libkern/libkern.h +++ b/sys/lib/libkern/libkern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: libkern.h,v 1.20 2004/05/06 01:12:05 deraadt Exp $ */ +/* $OpenBSD: libkern.h,v 1.21 2004/06/21 22:55:04 itojun Exp $ */ /* $NetBSD: libkern.h,v 1.7 1996/03/14 18:52:08 christos Exp $ */ /*- @@ -160,9 +160,12 @@ void srandom(u_long); int scanc(u_int, const u_char *, const u_char *, int); int skpc(int, size_t, u_char *); size_t strlen(const char *); -char *strncpy(char *, const char *, size_t); -size_t strlcpy(char *, const char *, size_t); -size_t strlcat(char *, const char *, size_t); +char *strncpy(char *, const char *, size_t) + __attribute__ ((__bounded__(__string__,1,3))); +size_t strlcpy(char *, const char *, size_t) + __attribute__ ((__bounded__(__string__,1,3))); +size_t strlcat(char *, const char *, size_t) + __attribute__ ((__bounded__(__string__,1,3))); int strcmp(const char *, const char *); int strncmp(const char *, const char *, size_t); int strncasecmp(const char *, const char *, size_t); |