Skip to content

Commit 6f023db

Browse files
committed
Fix incorrect check in cs_8559_5 in map_from_unicode()
The condition `code == 0x0450 || code == 0x045D` is always false because of an incorrect range check on code. According to the BMP coverage in the encoding spec for ISO-8859-5 (https://encoding.spec.whatwg.org/iso-8859-5-bmp.html) the range of valid characters is 0x0401 - 0x045F (except for 0x040D, 0x0450, 0x045D). The current check has an upper bound of 0x044F instead of 0x045F. Fix this by changing the upper bound.
1 parent f673449 commit 6f023db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/standard/html.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ static inline int map_from_unicode(unsigned code, enum entity_charset charset, u
477477
*res = 0xF0; /* numero sign */
478478
} else if (code == 0xA7) {
479479
*res = 0xFD; /* section sign */
480-
} else if (code >= 0x0401 && code <= 0x044F) {
480+
} else if (code >= 0x0401 && code <= 0x045F) {
481481
if (code == 0x040D || code == 0x0450 || code == 0x045D)
482482
return FAILURE;
483483
*res = code - 0x360;

0 commit comments

Comments
 (0)