aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacques Vidrine <nectar@FreeBSD.org>2003-08-03 23:47:39 +0000
committerJacques Vidrine <nectar@FreeBSD.org>2003-08-03 23:47:39 +0000
commitd873fa2ebe7d929b81db4d92d2ffe433f8128269 (patch)
tree873f944198ad1d233d80f78790f5fc9182d987ac
parent114d47957788c932402181ddfbe076251472c87c (diff)
downloadsrc-d873fa2ebe7d929b81db4d92d2ffe433f8128269.tar.gz
src-d873fa2ebe7d929b81db4d92d2ffe433f8128269.zip
realpath(3) bug fix: There was an off-by-one error in computing the
size of the resulting canonical path.
Notes
Notes: svn path=/releng/5.0/; revision=118401
-rw-r--r--UPDATING3
-rw-r--r--lib/libc/stdlib/realpath.c3
-rw-r--r--sys/conf/newvers.sh2
3 files changed, 6 insertions, 2 deletions
diff --git a/UPDATING b/UPDATING
index 8dc4da8a7e89..d25eaa9e06b9 100644
--- a/UPDATING
+++ b/UPDATING
@@ -17,6 +17,9 @@ minimal number of processes, if possible, for that patch. For those
updates that don't have an advisory, or to be safe, you can do a full
build and install as described in the COMMON ITEMS section.
+20030804: p8 FreeBSD-SA-03:08.realpath
+ Correct a single byte buffer overflow in realpath(3).
+
20030329: p7 FreeBSD-SA-03:07.sendmail
sendmail address parsing buffer overflow.
diff --git a/lib/libc/stdlib/realpath.c b/lib/libc/stdlib/realpath.c
index da6f1e20ee20..208052932630 100644
--- a/lib/libc/stdlib/realpath.c
+++ b/lib/libc/stdlib/realpath.c
@@ -140,7 +140,8 @@ loop:
rootd = 0;
if (*wbuf) {
- if (strlen(resolved) + strlen(wbuf) + rootd + 1 > MAXPATHLEN) {
+ if (strlen(resolved) + strlen(wbuf) + (1-rootd) + 1 >
+ MAXPATHLEN) {
errno = ENAMETOOLONG;
goto err1;
}
diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh
index 0f9c00a6e598..f5a10074dc54 100644
--- a/sys/conf/newvers.sh
+++ b/sys/conf/newvers.sh
@@ -36,7 +36,7 @@
TYPE="FreeBSD"
REVISION="5.0"
-BRANCH="RELEASE-p7"
+BRANCH="RELEASE-p8"
RELEASE="${REVISION}-${BRANCH}"
VERSION="${TYPE} ${RELEASE}"