artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
83adb6b
)
getcwd() operates on buffers of PATH_MAX including the NUL, and the +1
author
deraadt
<deraadt@openbsd.org>
Wed, 15 Dec 2021 04:01:52 +0000
(
04:01
+0000)
committer
deraadt
<deraadt@openbsd.org>
Wed, 15 Dec 2021 04:01:52 +0000
(
04:01
+0000)
is not unneccesary. Different buffer sizes are actually dangerous, though
major problems are strangely rare.
ok millert
bin/ksh/misc.c
patch
|
blob
|
history
diff --git
a/bin/ksh/misc.c
b/bin/ksh/misc.c
index
672b541
..
3d1e0cd
100644
(file)
--- a/
bin/ksh/misc.c
+++ b/
bin/ksh/misc.c
@@
-1,4
+1,4
@@
-/* $OpenBSD: misc.c,v 1.7
6 2020/10/26 18:16:51 tb Exp $
*/
+/* $OpenBSD: misc.c,v 1.7
7 2021/12/15 04:01:52 deraadt Exp $
*/
/*
* Miscellaneous functions
@@
-1135,7
+1135,7
@@
ksh_get_wd(char *buf, int bsize)
/* Assume getcwd() available */
if (!buf) {
bsize = PATH_MAX;
- b = alloc(
PATH_MAX + 1
, ATEMP);
+ b = alloc(
bsize
, ATEMP);
} else
b = buf;