Handle a long stream of bytes containing no UTF-8 character starts

2000-11-11  Havoc Pennington  <hp@pobox.com>

* gmarkup.c (g_markup_parse_context_parse): Handle a long stream
of bytes containing no UTF-8 character starts
This commit is contained in:
Havoc Pennington 2000-11-11 17:09:15 +00:00 committed by Havoc Pennington
parent ccc9329e1c
commit 96b9935a7c
10 changed files with 62 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2000-11-11 Havoc Pennington <hp@pobox.com>
* gmarkup.c (g_markup_parse_context_parse): Handle a long stream
of bytes containing no UTF-8 character starts
2000-11-11 Tor Lillqvist <tml@iki.fi>
* glib.def: Add missing entry points.

View File

@ -1,3 +1,8 @@
2000-11-11 Havoc Pennington <hp@pobox.com>
* gmarkup.c (g_markup_parse_context_parse): Handle a long stream
of bytes containing no UTF-8 character starts
2000-11-11 Tor Lillqvist <tml@iki.fi>
* glib.def: Add missing entry points.

View File

@ -1,3 +1,8 @@
2000-11-11 Havoc Pennington <hp@pobox.com>
* gmarkup.c (g_markup_parse_context_parse): Handle a long stream
of bytes containing no UTF-8 character starts
2000-11-11 Tor Lillqvist <tml@iki.fi>
* glib.def: Add missing entry points.

View File

@ -1,3 +1,8 @@
2000-11-11 Havoc Pennington <hp@pobox.com>
* gmarkup.c (g_markup_parse_context_parse): Handle a long stream
of bytes containing no UTF-8 character starts
2000-11-11 Tor Lillqvist <tml@iki.fi>
* glib.def: Add missing entry points.

View File

@ -1,3 +1,8 @@
2000-11-11 Havoc Pennington <hp@pobox.com>
* gmarkup.c (g_markup_parse_context_parse): Handle a long stream
of bytes containing no UTF-8 character starts
2000-11-11 Tor Lillqvist <tml@iki.fi>
* glib.def: Add missing entry points.

View File

@ -1,3 +1,8 @@
2000-11-11 Havoc Pennington <hp@pobox.com>
* gmarkup.c (g_markup_parse_context_parse): Handle a long stream
of bytes containing no UTF-8 character starts
2000-11-11 Tor Lillqvist <tml@iki.fi>
* glib.def: Add missing entry points.

View File

@ -1,3 +1,8 @@
2000-11-11 Havoc Pennington <hp@pobox.com>
* gmarkup.c (g_markup_parse_context_parse): Handle a long stream
of bytes containing no UTF-8 character starts
2000-11-11 Tor Lillqvist <tml@iki.fi>
* glib.def: Add missing entry points.

View File

@ -1,3 +1,8 @@
2000-11-11 Havoc Pennington <hp@pobox.com>
* gmarkup.c (g_markup_parse_context_parse): Handle a long stream
of bytes containing no UTF-8 character starts
2000-11-11 Tor Lillqvist <tml@iki.fi>
* glib.def: Add missing entry points.

View File

@ -889,6 +889,17 @@ g_markup_parse_context_parse (GMarkupParseContext *context,
g_string_append_len (context->leftover_char_portion,
text, text_len);
if (context->leftover_char_portion->len > 7)
{
/* The leftover char portion is too big to be
* a UTF-8 character
*/
set_error (context,
error,
G_MARKUP_ERROR_BAD_UTF8,
_("Invalid UTF-8 encoded text"));
}
goto finished;
}
}

View File

@ -889,6 +889,17 @@ g_markup_parse_context_parse (GMarkupParseContext *context,
g_string_append_len (context->leftover_char_portion,
text, text_len);
if (context->leftover_char_portion->len > 7)
{
/* The leftover char portion is too big to be
* a UTF-8 character
*/
set_error (context,
error,
G_MARKUP_ERROR_BAD_UTF8,
_("Invalid UTF-8 encoded text"));
}
goto finished;
}
}