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
commitca0731ec8f75ba7106ee3af21129434c593f40e2 (patch)
tree41afde06bcbf2b19ac705fadd65355fb066bc950
parent4b458f5c165de8d29b5bbc81be4d9327767566e6 (diff)
downloadsrc-ca0731ec8f75ba7106ee3af21129434c593f40e2.tar.gz
src-ca0731ec8f75ba7106ee3af21129434c593f40e2.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/4.3/; 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 1767b777e878..6c5c89c38d84 100644
--- a/UPDATING
+++ b/UPDATING
@@ -16,6 +16,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: p33 FreeBSD-SA-03:08.realpath
+ Correct a single byte buffer overflow in realpath(3).
+
20030329: p32 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 0217dde5f6a6..520624a9fef2 100644
--- a/lib/libc/stdlib/realpath.c
+++ b/lib/libc/stdlib/realpath.c
@@ -138,7 +138,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 c8ffb32def13..aaabe7ce885f 100644
--- a/sys/conf/newvers.sh
+++ b/sys/conf/newvers.sh
@@ -36,7 +36,7 @@
TYPE="FreeBSD"
REVISION="4.3"
-BRANCH="RELEASE-p32"
+BRANCH="RELEASE-p33"
RELEASE="${REVISION}-${BRANCH}"
VERSION="${TYPE} ${RELEASE}"