Browse Source

getcwd() buffer's length can be smaller than 1024. In that case it will

fail with errno set to ERANGE if not enough room is provided. Similar for
getlogin_r() so remove minbytes enforcement attribute.
ok kettenis@ guenther@ deraadt@ on getcwd, deraadt@ on getlogin_r.
OPENBSD_5_1
fgsch 13 years ago
parent
commit
abb53c9f3f
1 changed files with 3 additions and 5 deletions
  1. +3
    -5
      src/include/unistd.h

+ 3
- 5
src/include/unistd.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: unistd.h,v 1.65 2011/07/18 17:29:49 matthew Exp $ */
/* $OpenBSD: unistd.h,v 1.66 2011/11/09 15:34:18 fgsch Exp $ */
/* $NetBSD: unistd.h,v 1.26.4.1 1996/05/28 02:31:51 mrg Exp $ */ /* $NetBSD: unistd.h,v 1.26.4.1 1996/05/28 02:31:51 mrg Exp $ */
/*- /*-
@ -85,8 +85,7 @@ int execvp(const char *, char * const *);
pid_t fork(void); pid_t fork(void);
long fpathconf(int, int); long fpathconf(int, int);
char *getcwd(char *, size_t) char *getcwd(char *, size_t)
__attribute__((__bounded__(__string__,1,2)))
__attribute__((__bounded__(__minbytes__,1,1024)));
__attribute__((__bounded__(__string__,1,2)));
gid_t getegid(void); gid_t getegid(void);
uid_t geteuid(void); uid_t geteuid(void);
gid_t getgid(void); gid_t getgid(void);
@ -139,8 +138,7 @@ extern char *suboptarg; /* getsubopt(3) external variable */
int fsync(int); int fsync(int);
int ftruncate(int, off_t); int ftruncate(int, off_t);
int getlogin_r(char *, size_t) int getlogin_r(char *, size_t)
__attribute__((__bounded__(__string__,1,2)))
__attribute__((__bounded__(__minbytes__,1,32)));
__attribute__((__bounded__(__string__,1,2)));
#endif #endif
#if __XPG_VISIBLE || __BSD_VISIBLE #if __XPG_VISIBLE || __BSD_VISIBLE


Loading…
Cancel
Save