mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
nls: utf8_wcstombs: fix buffer overflow
utf8_wcstombs forgot to include one-byte UTF-8 characters when calculating the output buffer size, i.e., theoretically, it was possible to overflow the output buffer with an input string that contains enough ASCII characters. In practice, this was no problem because the only user so far (VFAT) always uses a big enough output buffer. Signed-off-by: Clemens Ladisch <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
e27ecdd94d
commit
905c02acbd
1 changed files with 1 additions and 0 deletions
|
|
@ -150,6 +150,7 @@ utf8_wcstombs(__u8 *s, const wchar_t *pwcs, int maxlen)
|
|||
}
|
||||
} else {
|
||||
*op++ = (__u8) *ip;
|
||||
maxlen--;
|
||||
}
|
||||
ip++;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue