mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 22:44:49 +00:00
ICU-8097 Fix buffer overflow problems in uscript_getCode()
X-SVN-Rev: 28953
This commit is contained in:
parent
334ad85355
commit
ad865ff7e7
1 changed files with 3 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
**********************************************************************
|
||||
* Copyright (C) 1997-2008, International Business Machines
|
||||
* Copyright (C) 1997-2010, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
**********************************************************************
|
||||
*
|
||||
|
@ -62,7 +62,7 @@ uscript_getCode(const char* nameOrAbbrOrLocale,
|
|||
u_UCharsToChars(name,cName,len);
|
||||
code = (UScriptCode) u_getPropertyValueEnum(UCHAR_SCRIPT, cName);
|
||||
/* got the script code now fill in the buffer */
|
||||
if(numFilled<=capacity){
|
||||
if(numFilled<capacity){
|
||||
*(fillIn)++=code;
|
||||
numFilled++;
|
||||
}else{
|
||||
|
@ -85,7 +85,7 @@ uscript_getCode(const char* nameOrAbbrOrLocale,
|
|||
}
|
||||
if(code!=(UScriptCode)UCHAR_INVALID_CODE){
|
||||
/* we found it */
|
||||
if(numFilled<=capacity){
|
||||
if(numFilled<capacity){
|
||||
*(fillIn)++=code;
|
||||
numFilled++;
|
||||
}else{
|
||||
|
|
Loading…
Add table
Reference in a new issue