diff options
| author | Andrey A. Chernov <ache@FreeBSD.org> | 2000-09-08 11:45:14 +0000 |
|---|---|---|
| committer | Andrey A. Chernov <ache@FreeBSD.org> | 2000-09-08 11:45:14 +0000 |
| commit | 8f36954927eff692a5d3b6ebf7d2875b5baef634 (patch) | |
| tree | 9f6bd3afd73e3a688e87dcc9b9833d88e907de96 /lib | |
| parent | fc52943f8c0cfba87d848712352302f3857208aa (diff) | |
Notes
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/libc/nls/msgcat.c | 8 |
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) { |
