diff options
author | Anil Madhavapeddy <avsm@cvs.openbsd.org> | 2003-08-01 17:38:34 +0000 |
---|---|---|
committer | Anil Madhavapeddy <avsm@cvs.openbsd.org> | 2003-08-01 17:38:34 +0000 |
commit | d68eb8fee6d53373bd6305628015b381d50e5a81 (patch) | |
tree | 1a024d606a1af2da709084dc790f2510d6665ae6 | |
parent | 594ac08ee4888800f45f3229059b0bcb5d56b45f (diff) |
add __bounded__ attributes for userland headers; enabled with -Wbounded
ok deraadt@
-rw-r--r-- | include/arpa/inet.h | 14 | ||||
-rw-r--r-- | include/bm.h | 5 | ||||
-rw-r--r-- | include/dirent.h | 5 | ||||
-rw-r--r-- | include/kvm.h | 8 | ||||
-rw-r--r-- | include/md4.h | 5 | ||||
-rw-r--r-- | include/md5.h | 5 | ||||
-rw-r--r-- | include/ohash.h | 5 | ||||
-rw-r--r-- | include/resolv.h | 18 | ||||
-rw-r--r-- | include/rmd160.h | 5 | ||||
-rw-r--r-- | include/sha1.h | 5 | ||||
-rw-r--r-- | include/stdio.h | 17 | ||||
-rw-r--r-- | include/stdlib.h | 8 | ||||
-rw-r--r-- | include/string.h | 40 | ||||
-rw-r--r-- | include/time.h | 11 | ||||
-rw-r--r-- | include/unistd.h | 37 | ||||
-rw-r--r-- | include/vis.h | 8 |
16 files changed, 127 insertions, 69 deletions
diff --git a/include/arpa/inet.h b/include/arpa/inet.h index a7212a6a457..63c42ac4111 100644 --- a/include/arpa/inet.h +++ b/include/arpa/inet.h @@ -1,4 +1,4 @@ -/* $OpenBSD: inet.h,v 1.8 2003/06/26 19:34:17 avsm Exp $ */ +/* $OpenBSD: inet.h,v 1.9 2003/08/01 17:38:33 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 859e0a983f0..f16731ff14c 100644 --- a/include/bm.h +++ b/include/bm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bm.h,v 1.6 2003/06/26 19:34:17 avsm Exp $ */ +/* $OpenBSD: bm.h,v 1.7 2003/08/01 17:38:33 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 2763c094998..a01f7853e95 100644 --- a/include/dirent.h +++ b/include/dirent.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dirent.h,v 1.12 2003/06/26 19:34:17 avsm Exp $ */ +/* $OpenBSD: dirent.h,v 1.13 2003/08/01 17:38:33 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 e31923069b2..4f729d50d8a 100644 --- a/include/kvm.h +++ b/include/kvm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: kvm.h,v 1.8 2003/06/26 19:34:17 avsm Exp $ */ +/* $OpenBSD: kvm.h,v 1.9 2003/08/01 17:38:33 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 e97f26a73fd..ba0202273fa 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.9 2003/06/26 19:34:17 avsm Exp $ + * $OpenBSD: md4.h,v 1.10 2003/08/01 17:38:33 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 4b1a7a43eda..b490c489c09 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.9 2003/06/26 19:34:17 avsm Exp $ + * $OpenBSD: md5.h,v 1.10 2003/08/01 17:38:33 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 bdb024a45db..f594cde3b73 100644 --- a/include/ohash.h +++ b/include/ohash.h @@ -1,6 +1,6 @@ #ifndef OHASH_H #define OHASH_H -/* $OpenBSD: ohash.h,v 1.5 2003/06/26 19:34:17 avsm Exp $ */ +/* $OpenBSD: ohash.h,v 1.6 2003/08/01 17:38:33 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 7a11eb31d00..7ce9726abb3 100644 --- a/include/resolv.h +++ b/include/resolv.h @@ -1,4 +1,4 @@ -/* $OpenBSD: resolv.h,v 1.13 2003/06/26 19:34:17 avsm Exp $ */ +/* $OpenBSD: resolv.h,v 1.14 2003/08/01 17:38:33 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 2fe1a4b9801..de1e034c170 100644 --- a/include/rmd160.h +++ b/include/rmd160.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rmd160.h,v 1.9 2003/06/26 19:34:17 avsm Exp $ */ +/* $OpenBSD: rmd160.h,v 1.10 2003/08/01 17:38:33 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 2ac214ed459..9df09a81b0d 100644 --- a/include/sha1.h +++ b/include/sha1.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sha1.h,v 1.13 2003/06/26 19:34:17 avsm Exp $ */ +/* $OpenBSD: sha1.h,v 1.14 2003/08/01 17:38:33 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 d94308a6498..92d842b433c 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdio.h,v 1.28 2003/06/26 19:34:17 avsm Exp $ */ +/* $OpenBSD: stdio.h,v 1.29 2003/08/01 17:38:33 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 d0f4e68ddda..85c69d0b64d 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdlib.h,v 1.27 2003/06/26 19:34:17 avsm Exp $ */ +/* $OpenBSD: stdlib.h,v 1.28 2003/08/01 17:38:33 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 bef70f2bc65..31e70d89369 100644 --- a/include/string.h +++ b/include/string.h @@ -1,4 +1,4 @@ -/* $OpenBSD: string.h,v 1.12 2003/06/26 19:34:17 avsm Exp $ */ +/* $OpenBSD: string.h,v 1.13 2003/08/01 17:38:33 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 268d45e8083..1e4e933c1f5 100644 --- a/include/time.h +++ b/include/time.h @@ -1,4 +1,4 @@ -/* $OpenBSD: time.h,v 1.15 2003/06/26 19:34:17 avsm Exp $ */ +/* $OpenBSD: time.h,v 1.16 2003/08/01 17:38:33 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 f448a955796..55e2f345908 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: unistd.h,v 1.49 2003/06/26 19:34:17 avsm Exp $ */ +/* $OpenBSD: unistd.h,v 1.50 2003/08/01 17:38:33 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 c5ee90fc86e..a6cd2cb843e 100644 --- a/include/vis.h +++ b/include/vis.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vis.h,v 1.8 2003/06/26 19:34:17 avsm Exp $ */ +/* $OpenBSD: vis.h,v 1.9 2003/08/01 17:38:33 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 |