summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>2000-09-08 11:45:14 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>2000-09-08 11:45:14 +0000
commit8f36954927eff692a5d3b6ebf7d2875b5baef634 (patch)
tree9f6bd3afd73e3a688e87dcc9b9833d88e907de96
parentfc52943f8c0cfba87d848712352302f3857208aa (diff)
Notes
-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) {