summaryrefslogtreecommitdiff
path: root/glib/gmarkup.c
diff options
context:
space:
mode:
authorMatthias Clasen <maclas@gmx.de>2004-06-02 02:02:31 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2004-06-02 02:02:31 +0000
commitdfce076fe4e2dba7fbdf55423ff5274d3553a2f8 (patch)
treef54bc0dca648802177ea66154ca3eea92866d583 /glib/gmarkup.c
parent1cbaf8d9136c28a69779b6766e9adddcfc84b44f (diff)
downloadglib-dfce076fe4e2dba7fbdf55423ff5274d3553a2f8.tar.gz
Fix an off-by-one error in g_markup_parse_context_parse(). (#142794,
Tue Jun 1 21:56:31 2004 Matthias Clasen <maclas@gmx.de> * glib/gmarkup.c (advance_char): Fix an off-by-one error in g_markup_parse_context_parse(). (#142794, Morten Welinder)
Diffstat (limited to 'glib/gmarkup.c')
-rw-r--r--glib/gmarkup.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/glib/gmarkup.c b/glib/gmarkup.c
index f50903058..c820f9a6e 100644
--- a/glib/gmarkup.c
+++ b/glib/gmarkup.c
@@ -662,16 +662,21 @@ unescape_text (GMarkupParseContext *context,
static gboolean
advance_char (GMarkupParseContext *context)
{
+ g_return_val_if_fail (context->iter != context->current_text_end, FALSE);
context->iter = g_utf8_next_char (context->iter);
context->char_number += 1;
+
+ if (context->iter == context->current_text_end)
+ return FALSE;
+
if (*context->iter == '\n')
{
context->line_number += 1;
context->char_number = 1;
}
- return context->iter != context->current_text_end;
+ return TRUE;
}
static gboolean