mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-20 20:19:32 +00:00
ICU-2341 fix buffer overflow in uconv with utf-16/32 converters that add a BOM
X-SVN-Rev: 10182
This commit is contained in:
parent
3c4333f7e1
commit
97d2e85372
1 changed files with 3 additions and 1 deletions
|
@ -555,7 +555,9 @@ static UBool convertFile(const char *pname,
|
|||
// the codepage that uses the most bytes and multiply it against
|
||||
// the buffer size.
|
||||
|
||||
tobufsz = bufsz * ucnv_getMaxCharSize(convto);
|
||||
// use bufsz+1 to allow for additional BOM/signature character (U+FEFF)
|
||||
tobufsz = (bufsz+1) * ucnv_getMaxCharSize(convto);
|
||||
|
||||
buf = new char[tobufsz];
|
||||
unibuf = new UChar[bufsz];
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue