[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-libunistring] [PATCH 1/8] gen-uni-tables: Check out-of-range values
From: |
Daiki Ueno |
Subject: |
[bug-libunistring] [PATCH 1/8] gen-uni-tables: Check out-of-range values added to 3-level tables |
Date: |
Fri, 10 Oct 2014 22:59:46 +0900 |
* lib/gen-uni-tables.c (output_category, output_bidi_category)
(output_joining_type, output_ident_category): Check out-of-range
values added to 3-level tables.
---
lib/gen-uni-tables.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/lib/gen-uni-tables.c b/lib/gen-uni-tables.c
index d00013e..56fe26c 100644
--- a/lib/gen-uni-tables.c
+++ b/lib/gen-uni-tables.c
@@ -1035,6 +1035,9 @@ output_category (const char *filename, const char
*version)
for (log2_value = 0; value > 1; value >>= 1, log2_value++);
+ if (log2_value > 0x1f)
+ abort ();
+
category_table_add (&t, ch, log2_value);
}
@@ -1525,6 +1528,9 @@ output_bidi_category (const char *filename, const char
*version)
{
int value = get_bidi_category (ch);
+ if (value > 0x1f)
+ abort ();
+
bidi_category_table_add (&t, ch, value);
}
@@ -3993,6 +3999,9 @@ output_joining_type (const char *filename, const char
*version)
{
uint8_t value = unicode_joining_type[ch];
+ if (value != (uint8_t)~(uint8_t)0 && value > 0x0f)
+ abort ();
+
joining_type_table_add (&t, ch, value);
}
@@ -5137,6 +5146,10 @@ output_ident_category (const char *filename, int
(*predicate) (unsigned int), co
for (ch = 0; ch < 0x110000; ch++)
{
int syntaxcode = predicate (ch);
+
+ if (syntaxcode > 0x03)
+ abort ();
+
if (syntaxcode != UC_IDENTIFIER_INVALID)
identsyntax_table_add (&t, ch, syntaxcode);
}
--
2.1.1
- [bug-libunistring] [PATCH 0/8] Update libunistring-related modules to Unicode 7.0.0, Daiki Ueno, 2014/10/10
- [bug-libunistring] [PATCH 1/8] gen-uni-tables: Check out-of-range values added to 3-level tables,
Daiki Ueno <=
- [bug-libunistring] [PATCH 2/8] unictype/joininggroup-of: Switch to 3-level table, Daiki Ueno, 2014/10/10
- [bug-libunistring] [PATCH 4/8] uniwbrk/u32-wordbreaks-tests: Test using WordBreakTest.txt from UCD, Daiki Ueno, 2014/10/10
- [bug-libunistring] [PATCH 3/8] uniwbrk: Ignore Extended/Format at the beginning of the line, Daiki Ueno, 2014/10/10
- [bug-libunistring] [PATCH 5/8] Update to Unicode 6.1.0, Daiki Ueno, 2014/10/10
- [bug-libunistring] [PATCH 7/8] Update to Unicode 6.3.0, Daiki Ueno, 2014/10/10
- [bug-libunistring] [PATCH 6/8] Update to Unicode 6.2.0, Daiki Ueno, 2014/10/10
- [bug-libunistring] [PATCH 8/8] Update to Unicode 7.0.0, Daiki Ueno, 2014/10/10