summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>2000-09-08 11:42:37 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>2000-09-08 11:42:37 +0000
commit86797bf9564e690104031b8786283c24e8c391e7 (patch)
treecdfbe8cfca4f9b46c85a9d791d2fc11276a8999d /lib/libc
parentf907abc0b30f5493b638edbbe6e92a5a14fa08ab (diff)
Notes
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/nls/msgcat.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/libc/nls/msgcat.c b/lib/libc/nls/msgcat.c
index 1dbdf4ffc428..5a0f9a921203 100644
--- a/lib/libc/nls/msgcat.c
+++ b/lib/libc/nls/msgcat.c
@@ -144,6 +144,8 @@ catopen( name, type)
++nlspath;
/* fallthrough */
default:
+ if (pathP - path >= sizeof(path) - 1)
+ goto too_long;
*(pathP++) = *nlspath;
continue;
}
@@ -151,13 +153,17 @@ catopen( name, type)
put_tmpptr:
spcleft = sizeof(path) - (pathP - path) - 1;
if (strlcpy(pathP, tmpptr, spcleft) >= spcleft) {
+ too_long:
free(plang);
free(base);
NLRETERR(ENAMETOOLONG);
}
pathP += strlen(tmpptr);
- } else
+ } else {
+ if (pathP - path >= sizeof(path) - 1)
+ goto too_long;
*(pathP++) = *nlspath;
+ }
}
*pathP = '\0';
if (stat(path, &sbuf) == 0) {