diff options
author | Chet Ramey <chet.ramey@case.edu> | 2015-05-19 14:55:27 -0400 |
---|---|---|
committer | Chet Ramey <chet.ramey@case.edu> | 2015-05-19 14:55:27 -0400 |
commit | e57a256f4ee0cefb0afc0e65bc3face6f9944b5b (patch) | |
tree | 519ca70e46efe7c0c81ecee98b5999bba341996b /lib | |
parent | 8daea13bac899cd26856747cbe836d0dce594d75 (diff) | |
download | bash-e57a256f4ee0cefb0afc0e65bc3face6f9944b5b.tar.gz |
Bash-4.3 patch 35
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sh/unicode.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/sh/unicode.c b/lib/sh/unicode.c index 9ee7147d..798260ec 100644 --- a/lib/sh/unicode.c +++ b/lib/sh/unicode.c @@ -78,13 +78,15 @@ stub_charset () s = strrchr (locale, '.'); if (s) { - strcpy (charsetbuf, s+1); + strncpy (charsetbuf, s+1, sizeof (charsetbuf) - 1); + charsetbuf[sizeof (charsetbuf) - 1] = '\0'; t = strchr (charsetbuf, '@'); if (t) *t = 0; return charsetbuf; } - strcpy (charsetbuf, locale); + strncpy (charsetbuf, locale, sizeof (charsetbuf) - 1); + charsetbuf[sizeof (charsetbuf) - 1] = '\0'; return charsetbuf; } #endif |