diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2009-07-15 13:59:20 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2009-07-15 14:00:31 -0400 |
commit | 67052645e6afcd7f72ef852c99ee88897d2022da (patch) | |
tree | 90ae6efbad01f32febc2fea57c8b1dd1005a6fdc /pango/break.c | |
parent | 4d6f980b9f67e7e969e6f5afeb6f216c0a99e6f4 (diff) | |
download | pango-67052645e6afcd7f72ef852c99ee88897d2022da.tar.gz |
Handle NUL in text in places that g_utf8_strlen () was used
While pango-layout doesn't allow NUL in text, the lower level API should
handle it correctly. We were using g_utf8_strlen() in a number of
places. This is problematic since that function stops processing at
NUL even if length>1. We now use an internal pango_utf8_strlen() instead.
Inspired by:
Bug 588678 – pango crash: install a new theme from gnome-appearance-properties
Diffstat (limited to 'pango/break.c')
-rw-r--r-- | pango/break.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pango/break.c b/pango/break.c index c1707456..b17dc606 100644 --- a/pango/break.c +++ b/pango/break.c @@ -24,6 +24,7 @@ #include "pango-break.h" #include "pango-modules.h" #include "pango-script-private.h" +#include "pango-impl-utils.h" #include <string.h> #define PARAGRAPH_SEPARATOR 0x2029 @@ -1809,7 +1810,7 @@ tailor_segment (const char *range_start, PangoLogAttr attr_before = log_attrs[0]; analysis->lang_engine = range_engine; - chars_in_range = g_utf8_strlen (range_start, range_end - range_start); + chars_in_range = pango_utf8_strlen (range_start, range_end - range_start); if (tailor_break (range_start, |