diff options
author | Chet Ramey <chet.ramey@case.edu> | 2015-05-19 14:55:27 -0400 |
---|---|---|
committer | Tom Powell <zifnab@zifnab06.net> | 2015-10-08 20:52:17 -0700 |
commit | 0bfa50e5e4afcdb89cc07dbeaf43201412416023 (patch) | |
tree | 5a4f4a4f4630150dbbcf54d37e48088bdbdfe09a /lib/sh/unicode.c | |
parent | ec1364fb33cd9a221649eeb362e00a2cfa4a66c1 (diff) | |
download | android_external_bash-0bfa50e5e4afcdb89cc07dbeaf43201412416023.tar.gz android_external_bash-0bfa50e5e4afcdb89cc07dbeaf43201412416023.tar.bz2 android_external_bash-0bfa50e5e4afcdb89cc07dbeaf43201412416023.zip |
Bash-4.3 patch 35
Change-Id: I76fde1c3875c716c5e19fd17e35c2f0dd0e44797
Diffstat (limited to 'lib/sh/unicode.c')
-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 9ee7147..798260e 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 |