summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAnil Madhavapeddy <avsm@cvs.openbsd.org>2003-06-26 18:35:14 +0000
committerAnil Madhavapeddy <avsm@cvs.openbsd.org>2003-06-26 18:35:14 +0000
commit8266dbf611a37e02c83c4da428f21a7d8c5bf801 (patch)
treeceefafa5cbc273538b74376d0e081cd83be48b84 /include
parent4f22ff20604dd441c644e14195a64eade733296f (diff)
Mark various standard library functions with the __bounded__ attribute.
You must have an up-to-date gcc for this! deraadt@ ok
Diffstat (limited to 'include')
-rw-r--r--include/arpa/inet.h14
-rw-r--r--include/bm.h5
-rw-r--r--include/dirent.h5
-rw-r--r--include/kvm.h8
-rw-r--r--include/md4.h5
-rw-r--r--include/md5.h5
-rw-r--r--include/ohash.h5
-rw-r--r--include/resolv.h18
-rw-r--r--include/rmd160.h5
-rw-r--r--include/sha1.h5
-rw-r--r--include/stdio.h17
-rw-r--r--include/stdlib.h8
-rw-r--r--include/string.h40
-rw-r--r--include/time.h11
-rw-r--r--include/unistd.h37
-rw-r--r--include/vis.h8
16 files changed, 127 insertions, 69 deletions
diff --git a/include/arpa/inet.h b/include/arpa/inet.h
index 9441c992b7b..84284f5a919 100644
--- a/include/arpa/inet.h
+++ b/include/arpa/inet.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: inet.h,v 1.6 2003/06/02 19:34:12 millert Exp $ */
+/* $OpenBSD: inet.h,v 1.7 2003/06/26 18:35:13 avsm Exp $ */
/*
* ++Copyright++ 1983, 1993
@@ -74,14 +74,18 @@ in_addr_t inet_addr(const char *);
int inet_aton(const char *, struct in_addr *);
in_addr_t inet_lnaof(struct in_addr);
struct in_addr inet_makeaddr(in_addr_t , in_addr_t);
-char * inet_neta(in_addr_t, char *, size_t);
+char * inet_neta(in_addr_t, char *, size_t)
+ __attribute__((__bounded__(__string__,2,3)));
in_addr_t inet_netof(struct in_addr);
in_addr_t inet_network(const char *);
-char *inet_net_ntop(int, const void *, int, char *, size_t);
-int inet_net_pton(int, const char *, void *, size_t);
+char *inet_net_ntop(int, const void *, int, char *, size_t)
+ __attribute__((__bounded__(__string__,4,5)));
+int inet_net_pton(int, const char *, void *, size_t)
+ __attribute__((__bounded__(__string__,3,4)));
char *inet_ntoa(struct in_addr);
int inet_pton(int, const char *, void *);
-const char *inet_ntop(int, const void *, char *, size_t);
+const char *inet_ntop(int, const void *, char *, size_t)
+ __attribute__ ((__bounded__(__string__,3,4)));
u_int inet_nsap_addr(const char *, u_char *, int);
char *inet_nsap_ntoa(int, const u_char *, char *);
__END_DECLS
diff --git a/include/bm.h b/include/bm.h
index 7c797aaafdf..d04317f24bc 100644
--- a/include/bm.h
+++ b/include/bm.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bm.h,v 1.4 2003/06/02 19:34:12 millert Exp $ */
+/* $OpenBSD: bm.h,v 1.5 2003/06/26 18:35:13 avsm Exp $ */
/* $NetBSD: bm.h,v 1.3 1994/10/26 00:55:46 cgd Exp $ */
/*-
@@ -51,7 +51,8 @@ typedef struct {
__BEGIN_DECLS
bm_pat *bm_comp(u_char const *, size_t, u_char const *);
-u_char *bm_exec(bm_pat *, u_char *, size_t);
+u_char *bm_exec(bm_pat *, u_char *, size_t)
+ __attribute__ ((__bounded__(__string__,2,3)));
void bm_free(bm_pat *);
__END_DECLS
diff --git a/include/dirent.h b/include/dirent.h
index d3fcec67250..8cdf02dcdec 100644
--- a/include/dirent.h
+++ b/include/dirent.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dirent.h,v 1.10 2003/06/02 19:34:12 millert Exp $ */
+/* $OpenBSD: dirent.h,v 1.11 2003/06/26 18:35:13 avsm Exp $ */
/* $NetBSD: dirent.h,v 1.9 1995/03/26 20:13:37 jtc Exp $ */
/*-
@@ -103,7 +103,8 @@ void seekdir(DIR *, long);
int scandir(const char *, struct dirent ***,
int (*)(struct dirent *), int (*)(const void *, const void *));
int alphasort(const void *, const void *);
-int getdirentries(int, char *, int, long *);
+int getdirentries(int, char *, int, long *)
+ __attribute__ ((__bounded__(__string__,2,3)));
#endif /* not POSIX */
int readdir_r(DIR *, struct dirent *, struct dirent **);
__END_DECLS
diff --git a/include/kvm.h b/include/kvm.h
index f3f7574847f..eba240c57bc 100644
--- a/include/kvm.h
+++ b/include/kvm.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: kvm.h,v 1.6 2003/06/02 19:34:12 millert Exp $ */
+/* $OpenBSD: kvm.h,v 1.7 2003/06/26 18:35:13 avsm Exp $ */
/* $NetBSD: kvm.h,v 1.7 1996/04/19 12:02:50 leo Exp $ */
/*-
@@ -70,8 +70,10 @@ kvm_t *kvm_open
(const char *, const char *, const char *, int, const char *);
kvm_t *kvm_openfiles
(const char *, const char *, const char *, int, char *);
-ssize_t kvm_read(kvm_t *, u_long, void *, size_t);
-ssize_t kvm_write(kvm_t *, u_long, const void *, size_t);
+ssize_t kvm_read(kvm_t *, u_long, void *, size_t)
+ __attribute__((__bounded__(__buffer__,3,4)));
+ssize_t kvm_write(kvm_t *, u_long, const void *, size_t)
+ __attribute__((__bounded__(__buffer__,3,4)));
__END_DECLS
diff --git a/include/md4.h b/include/md4.h
index 0bd4e4a5a08..9504b546515 100644
--- a/include/md4.h
+++ b/include/md4.h
@@ -1,5 +1,5 @@
/* MD4.H - header file for MD4C.C
- * $OpenBSD: md4.h,v 1.7 2002/12/23 04:33:31 millert Exp $
+ * $OpenBSD: md4.h,v 1.8 2003/06/26 18:35:13 avsm Exp $
*/
/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
@@ -42,7 +42,8 @@ void MD4Final(unsigned char [16], MD4_CTX *);
void MD4Transform(u_int32_t [4], const unsigned char [64]);
char * MD4End(MD4_CTX *, char *);
char * MD4File(char *, char *);
-char * MD4Data(const unsigned char *, size_t, char *);
+char * MD4Data(const unsigned char *, size_t, char *)
+ __attribute__((__bounded__(__string__,3,2)));
__END_DECLS
#endif /* _MD4_H_ */
diff --git a/include/md5.h b/include/md5.h
index 958340196eb..823c6066a67 100644
--- a/include/md5.h
+++ b/include/md5.h
@@ -1,5 +1,5 @@
/* MD5.H - header file for MD5C.C
- * $OpenBSD: md5.h,v 1.7 2002/12/23 04:33:31 millert Exp $
+ * $OpenBSD: md5.h,v 1.8 2003/06/26 18:35:13 avsm Exp $
*/
/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
@@ -43,7 +43,8 @@ void MD5Final(unsigned char [16], MD5_CTX *);
void MD5Transform(u_int32_t [4], const unsigned char [64]);
char * MD5End(MD5_CTX *, char *);
char * MD5File(char *, char *);
-char * MD5Data(const unsigned char *, size_t, char *);
+char * MD5Data(const unsigned char *, size_t, char *)
+ __attribute__ ((__bounded__(__string__,3,2)));
__END_DECLS
#endif /* _MD5_H_ */
diff --git a/include/ohash.h b/include/ohash.h
index 6e7a6c2f483..7824bccd7ad 100644
--- a/include/ohash.h
+++ b/include/ohash.h
@@ -1,6 +1,6 @@
#ifndef OHASH_H
#define OHASH_H
-/* $OpenBSD: ohash.h,v 1.3 2002/02/17 19:42:21 millert Exp $ */
+/* $OpenBSD: ohash.h,v 1.4 2003/06/26 18:35:13 avsm Exp $ */
/* ex:ts=8 sw=4:
*/
@@ -68,7 +68,8 @@ unsigned int ohash_lookup_string(struct ohash *, const char *, u_int32_t);
unsigned int ohash_lookup_interval(struct ohash *, const char *,
const char *, u_int32_t);
unsigned int ohash_lookup_memory(struct ohash *, const char *,
- size_t, u_int32_t);
+ size_t, u_int32_t)
+ __attribute__ ((__bounded__(__string__,2,3)));
void *ohash_find(struct ohash *, unsigned int);
void *ohash_remove(struct ohash *, unsigned int);
void *ohash_insert(struct ohash *, unsigned int, void *);
diff --git a/include/resolv.h b/include/resolv.h
index 3ff30ac10dd..54cfdb8fc12 100644
--- a/include/resolv.h
+++ b/include/resolv.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: resolv.h,v 1.11 2003/06/02 19:34:12 millert Exp $ */
+/* $OpenBSD: resolv.h,v 1.12 2003/06/26 18:35:13 avsm Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -333,13 +333,19 @@ int dn_expand(const u_char *, const u_char *, const u_char *,
char *, int);
int res_init(void);
u_int res_randomid(void);
-int res_query(const char *, int, int, u_char *, int);
-int res_search(const char *, int, int, u_char *, int);
+int res_query(const char *, int, int, u_char *, int)
+ __attribute__((__bounded__(__string__,4,5)));
+int res_search(const char *, int, int, u_char *, int)
+ __attribute__((__bounded__(__string__,4,5)));
int res_querydomain(const char *, const char *, int, int,
- u_char *, int);
+ u_char *, int)
+ __attribute__((__bounded__(__string__,5,6)));
int res_mkquery(int, const char *, int, int, const u_char *, int,
- const u_char *, u_char *, int);
-int res_send(const u_char *, int, u_char *, int);
+ const u_char *, u_char *, int)
+ __attribute__((__bounded__(__string__,5,6)))
+ __attribute__((__bounded__(__string__,8,9)));
+int res_send(const u_char *, int, u_char *, int)
+ __attribute__((__bounded__(__string__,3,4)));
int res_isourserver(const struct sockaddr_in *);
int res_nameinquery(const char *, int, int,
const u_char *, const u_char *);
diff --git a/include/rmd160.h b/include/rmd160.h
index b31b07f6e87..9cad98f25b5 100644
--- a/include/rmd160.h
+++ b/include/rmd160.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rmd160.h,v 1.7 2002/12/23 04:33:31 millert Exp $ */
+/* $OpenBSD: rmd160.h,v 1.8 2003/06/26 18:35:13 avsm Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
*
@@ -41,7 +41,8 @@ void RMD160Update(RMD160_CTX *, const u_char *, u_int32_t);
void RMD160Final(u_char [20], RMD160_CTX *);
char *RMD160End(RMD160_CTX *, char *);
char *RMD160File(char *, char *);
-char *RMD160Data(const u_char *, size_t, char *);
+char *RMD160Data(const u_char *, size_t, char *)
+ __attribute__((__bounded__(__string__,3,2)));
__END_DECLS
#endif /* _RMD160_H */
diff --git a/include/sha1.h b/include/sha1.h
index 613a7140969..0521bf6a3b0 100644
--- a/include/sha1.h
+++ b/include/sha1.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sha1.h,v 1.11 2002/12/23 04:33:31 millert Exp $ */
+/* $OpenBSD: sha1.h,v 1.12 2003/06/26 18:35:13 avsm Exp $ */
/*
* SHA-1 in C
@@ -24,7 +24,8 @@ void SHA1Update(SHA1_CTX *context, const u_char *data, u_int len);
void SHA1Final(u_char digest[20], SHA1_CTX *context);
char *SHA1End(SHA1_CTX *, char *);
char *SHA1File(char *, char *);
-char *SHA1Data(const u_char *, size_t, char *);
+char *SHA1Data(const u_char *, size_t, char *)
+ __attribute__((__bounded__ (__string__,3,2)));
__END_DECLS
#define SHA1_DIGESTSIZE 20
diff --git a/include/stdio.h b/include/stdio.h
index 57ad41a0bda..7453eb4265e 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: stdio.h,v 1.26 2003/06/02 19:34:12 millert Exp $ */
+/* $OpenBSD: stdio.h,v 1.27 2003/06/26 18:35:13 avsm Exp $ */
/* $NetBSD: stdio.h,v 1.18 1996/04/25 18:29:21 jtc Exp $ */
/*-
@@ -214,12 +214,14 @@ int ferror(FILE *);
int fflush(FILE *);
int fgetc(FILE *);
int fgetpos(FILE *, fpos_t *);
-char *fgets(char *, int, FILE *);
+char *fgets(char *, int, FILE *)
+ __attribute__((__bounded__ (__string__,1,2)));
FILE *fopen(const char *, const char *);
int fprintf(FILE *, const char *, ...);
int fputc(int, FILE *);
int fputs(const char *, FILE *);
-size_t fread(void *, size_t, size_t, FILE *);
+size_t fread(void *, size_t, size_t, FILE *)
+ __attribute__((__bounded__ (__size__,1,3,2)));
FILE *freopen(const char *, const char *, FILE *);
int fscanf(FILE *, const char *, ...);
int fseek(FILE *, long, int);
@@ -227,7 +229,8 @@ int fseeko(FILE *, off_t, int);
int fsetpos(FILE *, const fpos_t *);
long ftell(FILE *);
off_t ftello(FILE *);
-size_t fwrite(const void *, size_t, size_t, FILE *);
+size_t fwrite(const void *, size_t, size_t, FILE *)
+ __attribute__((__bounded__ (__size__,1,3,2)));
int getc(FILE *);
int getchar(void);
char *gets(char *);
@@ -313,13 +316,15 @@ int setlinebuf(FILE *);
char *tempnam(const char *, const char *);
int snprintf(char *, size_t, const char *, ...)
__attribute__((__format__ (printf, 3, 4)))
- __attribute__((__nonnull__ (3)));
+ __attribute__((__nonnull__ (3)))
+ __attribute__((__bounded__ (__string__,1,2)));
int vasprintf(char **, const char *, _BSD_VA_LIST_)
__attribute__((__format__ (printf, 2, 0)))
__attribute__((__nonnull__ (2)));
int vsnprintf(char *, size_t, const char *, _BSD_VA_LIST_)
__attribute__((__format__ (printf, 3, 0)))
- __attribute__((__nonnull__ (3)));
+ __attribute__((__nonnull__ (3)))
+ __attribute__((__bounded__(__string__,1,2)));
int vscanf(const char *, _BSD_VA_LIST_)
__attribute__((__format__ (scanf, 1, 0)))
__attribute__((__nonnull__ (1)));
diff --git a/include/stdlib.h b/include/stdlib.h
index 35440f2af5c..27f52092a8c 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: stdlib.h,v 1.25 2003/06/02 19:34:12 millert Exp $ */
+/* $OpenBSD: stdlib.h,v 1.26 2003/06/26 18:35:13 avsm Exp $ */
/* $NetBSD: stdlib.h,v 1.25 1995/12/27 21:19:08 jtc Exp $ */
/*-
@@ -188,7 +188,8 @@ int radixsort(const unsigned char **, int, const unsigned char *,
int sradixsort(const unsigned char **, int, const unsigned char *,
unsigned);
-char *initstate(unsigned int, char *, size_t);
+char *initstate(unsigned int, char *, size_t)
+ __attribute__((__bounded__ (__string__,2,3)));
long random(void);
char *realpath(const char *, char *);
char *setstate(const char *);
@@ -218,7 +219,8 @@ void srand48(long);
u_int32_t arc4random(void);
void arc4random_stir(void);
-void arc4random_addrandom(unsigned char *, int);
+void arc4random_addrandom(unsigned char *, int)
+ __attribute__((__bounded__ (__string__,1,2)));
#endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */
__END_DECLS
diff --git a/include/string.h b/include/string.h
index 371cf091279..5cf0dd09a22 100644
--- a/include/string.h
+++ b/include/string.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: string.h,v 1.10 2003/06/02 19:34:12 millert Exp $ */
+/* $OpenBSD: string.h,v 1.11 2003/06/26 18:35:13 avsm Exp $ */
/* $NetBSD: string.h,v 1.6 1994/10/26 00:56:30 cgd Exp $ */
/*-
@@ -54,9 +54,14 @@ typedef _BSD_SIZE_T_ size_t;
__BEGIN_DECLS
void *memchr(const void *, int, size_t);
int memcmp(const void *, const void *, size_t);
-void *memcpy(void *, const void *, size_t);
-void *memmove(void *, const void *, size_t);
-void *memset(void *, int, size_t);
+void *memcpy(void *, const void *, size_t)
+ __attribute__ ((__bounded__(__buffer__,1,3)))
+ __attribute__ ((__bounded__(__buffer__,2,3)));
+void *memmove(void *, const void *, size_t)
+ __attribute__ ((__bounded__(__buffer__,1,3)))
+ __attribute__ ((__bounded__(__buffer__,2,3)));
+void *memset(void *, int, size_t)
+ __attribute__ ((__bounded__(__buffer__,1,3)));
char *strcat(char *, const char *);
char *strchr(const char *, int);
int strcmp(const char *, const char *);
@@ -64,32 +69,41 @@ int strcoll(const char *, const char *);
char *strcpy(char *, const char *);
size_t strcspn(const char *, const char *);
char *strerror(int);
-int strerror_r(int, char *, size_t);
+int strerror_r(int, char *, size_t)
+ __attribute__ ((__bounded__(__string__,2,3)));
size_t strlen(const char *);
-char *strncat(char *, const char *, size_t);
+char *strncat(char *, const char *, size_t)
+ __attribute__ ((__bounded__(__string__,1,3)));
int strncmp(const char *, const char *, size_t);
-char *strncpy(char *, const char *, size_t);
+char *strncpy(char *, const char *, size_t)
+ __attribute__ ((__bounded__(__string__,1,3)));
char *strpbrk(const char *, const char *);
char *strrchr(const char *, int);
size_t strspn(const char *, const char *);
char *strstr(const char *, const char *);
char *strtok(char *, const char *);
char *strtok_r(char *, const char *, char **);
-size_t strxfrm(char *, const char *, size_t);
+size_t strxfrm(char *, const char *, size_t)
+ __attribute__ ((__bounded__(__string__,1,3)));
/* Nonstandard routines */
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
int bcmp(const void *, const void *, size_t);
-void bcopy(const void *, void *, size_t);
-void bzero(void *, size_t);
+void bcopy(const void *, void *, size_t)
+ __attribute__ ((__bounded__(__buffer__,2,3)));
+void bzero(void *, size_t)
+ __attribute__ ((__bounded__(__buffer__,1,2)));
int ffs(int);
char *index(const char *, int);
-void *memccpy(void *, const void *, int, size_t);
+void *memccpy(void *, const void *, int, size_t)
+ __attribute__ ((__bounded__(__buffer__,1,4)));
char *rindex(const char *, int);
int strcasecmp(const char *, const char *);
char *strdup(const char *);
-size_t strlcat(char *, const char *, size_t);
-size_t strlcpy(char *, const char *, size_t);
+size_t strlcat(char *, const char *, size_t)
+ __attribute__ ((__bounded__(__string__,1,3)));
+size_t strlcpy(char *, const char *, size_t)
+ __attribute__ ((__bounded__(__string__,1,3)));
void strmode(int, char *);
int strncasecmp(const char *, const char *, size_t);
char *strsep(char **, const char *);
diff --git a/include/time.h b/include/time.h
index dbe0652e084..db530102cd4 100644
--- a/include/time.h
+++ b/include/time.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: time.h,v 1.13 2003/06/02 19:34:12 millert Exp $ */
+/* $OpenBSD: time.h,v 1.14 2003/06/26 18:35:13 avsm Exp $ */
/* $NetBSD: time.h,v 1.9 1994/10/26 00:56:35 cgd Exp $ */
/*
@@ -93,11 +93,14 @@ double difftime(time_t, time_t);
struct tm *gmtime(const time_t *);
struct tm *localtime(const time_t *);
time_t mktime(struct tm *);
-size_t strftime(char *, size_t, const char *, const struct tm *);
+size_t strftime(char *, size_t, const char *, const struct tm *)
+ __attribute__ ((__bounded__(__string__,1,2)));
char *strptime(const char *, const char *, struct tm *);
time_t time(time_t *);
-char *asctime_r(const struct tm *, char *);
-char *ctime_r(const time_t *, char *);
+char *asctime_r(const struct tm *, char *)
+ __attribute__ ((__bounded__(__minbytes__,2,26)));
+char *ctime_r(const time_t *, char *)
+ __attribute__ ((__bounded__(__minbytes__,2,26)));
struct tm *gmtime_r(const time_t *, struct tm *);
struct tm *localtime_r(const time_t *, struct tm *);
int nanosleep(const struct timespec *, struct timespec *);
diff --git a/include/unistd.h b/include/unistd.h
index 85c33403e33..d141371e754 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: unistd.h,v 1.47 2003/06/02 19:34:12 millert Exp $ */
+/* $OpenBSD: unistd.h,v 1.48 2003/06/26 18:35:13 avsm Exp $ */
/* $NetBSD: unistd.h,v 1.26.4.1 1996/05/28 02:31:51 mrg Exp $ */
/*-
@@ -58,7 +58,8 @@ unsigned int alarm(unsigned int);
int chdir(const char *);
int chown(const char *, uid_t, gid_t);
int close(int);
-size_t confstr(int, char *, size_t);
+size_t confstr(int, char *, size_t)
+ __attribute__((__bounded__(__string__,2,3)));
char *cuserid(char *);
int dup(int);
int dup2(int, int);
@@ -73,13 +74,17 @@ int execve(const char *, char * const *, char * const *);
int execvp(const char *, char * const *);
pid_t fork(void);
long fpathconf(int, int);
-char *getcwd(char *, size_t);
+char *getcwd(char *, size_t)
+ __attribute__((__bounded__(__string__,1,2)))
+ __attribute__((__bounded__(__minbytes__,1,1024)));
gid_t getegid(void);
uid_t geteuid(void);
gid_t getgid(void);
int getgroups(int, gid_t *);
char *getlogin(void);
-int getlogin_r(char *, size_t);
+int getlogin_r(char *, size_t)
+ __attribute__((__bounded__(__string__,1,2)))
+ __attribute__((__bounded__(__minbytes__,1,32)));
pid_t getpgrp(void);
pid_t getpid(void);
pid_t getpgid(pid_t);
@@ -92,7 +97,8 @@ off_t lseek(int, off_t, int);
long pathconf(const char *, int);
int pause(void);
int pipe(int *);
-ssize_t read(int, void *, size_t);
+ssize_t read(int, void *, size_t)
+ __attribute__((__bounded__(__buffer__,2,3)));
int rmdir(const char *);
int setgid(gid_t);
int setpgid(pid_t, pid_t);
@@ -103,9 +109,11 @@ long sysconf(int);
pid_t tcgetpgrp(int);
int tcsetpgrp(int, pid_t);
char *ttyname(int);
-int ttyname_r(int, char *, size_t);
+int ttyname_r(int, char *, size_t)
+ __attribute__((__bounded__(__string__,2,3)));
int unlink(const char *);
-ssize_t write(int, const void *, size_t);
+ssize_t write(int, const void *, size_t)
+ __attribute__((__bounded__(__buffer__,2,3)));
#ifndef _POSIX_SOURCE
@@ -135,18 +143,21 @@ int fchown(int, uid_t, gid_t);
char *fflagstostr(u_int32_t);
int fsync(int);
int ftruncate(int, off_t);
-int getdomainname(char *, size_t);
+int getdomainname(char *, size_t)
+ __attribute__ ((__bounded__(__string__,1,2)));
int getdtablesize(void);
int getgrouplist(const char *, gid_t, gid_t *, int *);
long gethostid(void);
-int gethostname(char *, size_t);
+int gethostname(char *, size_t)
+ __attribute__ ((__bounded__(__string__,1,2)));
mode_t getmode(const void *, mode_t);
int getpagesize(void);
int getresgid(gid_t *, gid_t *, gid_t *);
int getresuid(uid_t *, uid_t *, uid_t *);
char *getpass(const char *);
char *getusershell(void);
-char *getwd(char *); /* obsoleted by getcwd() */
+char *getwd(char *)
+ __attribute__ ((__bounded__(__minbytes__,1,1024)));
int initgroups(const char *, gid_t);
int iruserok(u_int32_t, int, const char *, const char *);
int iruserok_sa(const void *, int, int, const char *, const char *);
@@ -159,7 +170,8 @@ int nfssvc(int, void *);
int nice(int);
void psignal(unsigned int, const char *);
extern __const char *__const sys_siglist[];
-int profil(char *, size_t, unsigned long, unsigned int);
+int profil(char *, size_t, unsigned long, unsigned int)
+ __attribute__ ((__bounded__(__string__,1,2)));
int rcmd(char **, int, const char *,
const char *, const char *, int *);
int rcmd_af(char **, int, const char *,
@@ -168,7 +180,8 @@ int rcmdsh(char **, int, const char *,
const char *, const char *, char *);
char *re_comp(const char *);
int re_exec(const char *);
-int readlink(const char *, char *, size_t);
+int readlink(const char *, char *, size_t)
+ __attribute__ ((__bounded__(__string__,2,3)));
int reboot(int);
int revoke(const char *);
int rfork(int opts);
diff --git a/include/vis.h b/include/vis.h
index d705ab1324b..c39d8afbdc9 100644
--- a/include/vis.h
+++ b/include/vis.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vis.h,v 1.6 2003/06/02 19:34:12 millert Exp $ */
+/* $OpenBSD: vis.h,v 1.7 2003/06/26 18:35:13 avsm Exp $ */
/* $NetBSD: vis.h,v 1.4 1994/10/26 00:56:41 cgd Exp $ */
/*-
@@ -75,8 +75,10 @@
__BEGIN_DECLS
char *vis(char *, int, int, int);
int strvis(char *, const char *, int);
-int strnvis(char *, const char *, size_t, int);
-int strvisx(char *, const char *, size_t, int);
+int strnvis(char *, const char *, size_t, int)
+ __attribute__ ((__bounded__(__string__,1,3)));
+int strvisx(char *, const char *, size_t, int)
+ __attribute__ ((__bounded__(__string__,1,3)));
int strunvis(char *, const char *);
int unvis(char *, char, int *, int);
__END_DECLS