mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 09:41:15 +00:00
Correct checks for validity of the second UTF16 value in a surrogate pair
This commit is contained in:
parent
5aa4b7a732
commit
8178e52806
1 changed files with 2 additions and 2 deletions
|
@ -1936,7 +1936,7 @@ GSFromUnicode(unsigned char **dst, unsigned int *size, const unichar *src,
|
|||
u2 = src[spos++];
|
||||
u2 = (((u2 & 0xff00) >> 8) + ((u2 & 0x00ff) << 8));
|
||||
|
||||
if ((u2 < 0xdc00) && (u2 > 0xdfff))
|
||||
if ((u2 < 0xdc00) || (u2 > 0xdfff))
|
||||
{
|
||||
spos--;
|
||||
if (strict)
|
||||
|
@ -2054,7 +2054,7 @@ GSFromUnicode(unsigned char **dst, unsigned int *size, const unichar *src,
|
|||
/* get second unichar */
|
||||
u2 = src[spos++];
|
||||
|
||||
if ((u2 < 0xdc00) && (u2 > 0xdfff))
|
||||
if ((u2 < 0xdc00) || (u2 > 0xdfff))
|
||||
{
|
||||
spos--;
|
||||
if (strict)
|
||||
|
|
Loading…
Reference in a new issue