Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Unified Diff: source/test/cintltst/cbiditst.c

Issue 566073003: Fix a bug in ICU's bidi handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/icu52/
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/common/ubidiimp.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/test/cintltst/cbiditst.c
===================================================================
--- source/test/cintltst/cbiditst.c (revision 291619)
+++ source/test/cintltst/cbiditst.c (working copy)
@@ -84,6 +84,8 @@
static void doTailTest(void);
+static void testBracketOverflow(void);
+
/* new BIDI API */
static void testReorderingMode(void);
static void testReorderRunsOnly(void);
@@ -130,6 +132,7 @@
addTest(root, testClassOverride, "complex/bidi/TestClassOverride");
addTest(root, testGetBaseDirection, "complex/bidi/testGetBaseDirection");
addTest(root, testContext, "complex/bidi/testContext");
+ addTest(root, testBracketOverflow, "complex/bidi/TestBracketOverflow");
addTest(root, doArabicShapingTest, "complex/arabic-shaping/ArabicShapingTest");
addTest(root, doLamAlefSpecialVLTRArabicShapingTest, "complex/arabic-shaping/lamalef");
@@ -4654,3 +4657,25 @@
log_verbose("\nExiting TestContext \n\n");
}
+
+/* Ticket#11054 ubidi_setPara crash with heavily nested brackets */
+static void
+testBracketOverflow(void) {
+ static const char* TEXT = "(((((((((((((((((((((((((((((((((((((((((a)(A)))))))))))))))))))))))))))))))))))))))))";
+ UErrorCode status = U_ZERO_ERROR;
+ UBiDi* bidi;
+ UChar src[100];
+ UChar dest[100];
+ int32_t len;
+
+ bidi = ubidi_open();
+ len = uprv_strlen(TEXT);
+ pseudoToU16(len, TEXT, src);
+ ubidi_setPara(bidi, src, len, UBIDI_DEFAULT_LTR , NULL, &status);
+ if (U_FAILURE(status)) {
+ log_err("setPara failed with heavily nested brackets - %s", u_errorName(status));
+ }
+
+ ubidi_close(bidi);
+}
+
« no previous file with comments | « source/common/ubidiimp.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698