summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2003-04-15 19:59:53 +0000
committerOwen Taylor <otaylor@src.gnome.org>2003-04-15 19:59:53 +0000
commit19609d22b72a9f76bec6c74403846e8f085689c4 (patch)
treef53fb0ea3546284c4162053a5c8642f504cc7095 /modules
parent455e962004aebc6856da324640d9639fa66dd1a5 (diff)
downloadpango-19609d22b72a9f76bec6c74403846e8f085689c4.tar.gz
Fix out-of-bounds read where the value wasn't actually used. (#106744,
Tue Apr 15 03:54:01 2003 Owen Taylor <otaylor@redhat.com> * modules/hangul/hangul-{x,xft}.c: Fix out-of-bounds read where the value wasn't actually used. (#106744, Morten Welinder)
Diffstat (limited to 'modules')
-rw-r--r--modules/hangul/hangul-x.c26
-rw-r--r--modules/hangul/hangul-xft.c28
2 files changed, 29 insertions, 25 deletions
diff --git a/modules/hangul/hangul-x.c b/modules/hangul/hangul-x.c
index 1cf5c91c..21e956d6 100644
--- a/modules/hangul/hangul-x.c
+++ b/modules/hangul/hangul-x.c
@@ -739,24 +739,26 @@ hangul_engine_shape (PangoFont *font,
for (i = 0; i < n_chars; i++)
{
- gunichar prev = jamos[n_jamos - 1];
gunichar wc;
wc = g_utf8_get_char (p);
/* Check syllable boundaries. */
- if (n_jamos &&
- ((!IS_L (prev) && IS_S (wc)) ||
- (IS_T (prev) && IS_L (wc)) ||
- (IS_V (prev) && IS_L (wc)) ||
- (IS_T (prev) && IS_V (wc))))
+ if (n_jamos)
{
- /* Draw a syllable. */
-
- (*render_func) (font, subfont, jamos, n_jamos,
- glyphs, &n_glyphs, start - text);
- n_jamos = 0;
- start = p;
+ gunichar prev = jamos[n_jamos - 1];
+ if ((!IS_L (prev) && IS_S (wc)) ||
+ (IS_T (prev) && IS_L (wc)) ||
+ (IS_V (prev) && IS_L (wc)) ||
+ (IS_T (prev) && IS_V (wc)))
+ {
+ /* Draw a syllable. */
+
+ (*render_func) (font, subfont, jamos, n_jamos,
+ glyphs, &n_glyphs, start - text);
+ n_jamos = 0;
+ start = p;
+ }
}
if (n_jamos == max_jamos)
diff --git a/modules/hangul/hangul-xft.c b/modules/hangul/hangul-xft.c
index be796693..09bd6002 100644
--- a/modules/hangul/hangul-xft.c
+++ b/modules/hangul/hangul-xft.c
@@ -294,26 +294,28 @@ hangul_engine_shape (PangoFont *font,
for (i = 0; i < n_chars; i++)
{
- gunichar prev = jamos[n_jamos - 1];
gunichar wc;
wc = g_utf8_get_char (p);
/* Check syllable boundaries. */
- if (n_jamos &&
- ((!IS_L (prev) && IS_S (wc)) ||
- (IS_T (prev) && IS_L (wc)) ||
- (IS_V (prev) && IS_L (wc)) ||
- (IS_T (prev) && IS_V (wc)) ||
- IS_M(prev)))
+ if (n_jamos)
{
- /* Draw a syllable. */
- render_syllable (font, jamos, n_jamos, glyphs,
- &n_glyphs, start - text);
- n_jamos = 0;
- start = p;
+ gunichar prev = jamos[n_jamos - 1];
+ if ((!IS_L (prev) && IS_S (wc)) ||
+ (IS_T (prev) && IS_L (wc)) ||
+ (IS_V (prev) && IS_L (wc)) ||
+ (IS_T (prev) && IS_V (wc)) ||
+ IS_M(prev))
+ {
+ /* Draw a syllable. */
+ render_syllable (font, jamos, n_jamos, glyphs,
+ &n_glyphs, start - text);
+ n_jamos = 0;
+ start = p;
+ }
}
-
+
if (n_jamos == max_jamos)
{
max_jamos += 3; /* at most 3 for each syllable code (L+V+T) */