diff --git a/ChangeLog b/ChangeLog index dff6a7836..f5583795d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2002-01-28 Havoc Pennington + + * glib/gmarkup.c (add_attribute): NULL-terminate + context->attr_values so g_strfreev() is safe. + Would previously crash if parsing was ended prior + to ending the start tag. + (g_markup_parse_context_parse): add a couple assertions + 2002-01-28 Havoc Pennington * glib/gmacros.h: get rid of warning here diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index dff6a7836..f5583795d 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,11 @@ +2002-01-28 Havoc Pennington + + * glib/gmarkup.c (add_attribute): NULL-terminate + context->attr_values so g_strfreev() is safe. + Would previously crash if parsing was ended prior + to ending the start tag. + (g_markup_parse_context_parse): add a couple assertions + 2002-01-28 Havoc Pennington * glib/gmacros.h: get rid of warning here diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index dff6a7836..f5583795d 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +2002-01-28 Havoc Pennington + + * glib/gmarkup.c (add_attribute): NULL-terminate + context->attr_values so g_strfreev() is safe. + Would previously crash if parsing was ended prior + to ending the start tag. + (g_markup_parse_context_parse): add a couple assertions + 2002-01-28 Havoc Pennington * glib/gmacros.h: get rid of warning here diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index dff6a7836..f5583795d 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,11 @@ +2002-01-28 Havoc Pennington + + * glib/gmarkup.c (add_attribute): NULL-terminate + context->attr_values so g_strfreev() is safe. + Would previously crash if parsing was ended prior + to ending the start tag. + (g_markup_parse_context_parse): add a couple assertions + 2002-01-28 Havoc Pennington * glib/gmacros.h: get rid of warning here diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index dff6a7836..f5583795d 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,11 @@ +2002-01-28 Havoc Pennington + + * glib/gmarkup.c (add_attribute): NULL-terminate + context->attr_values so g_strfreev() is safe. + Would previously crash if parsing was ended prior + to ending the start tag. + (g_markup_parse_context_parse): add a couple assertions + 2002-01-28 Havoc Pennington * glib/gmacros.h: get rid of warning here diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index dff6a7836..f5583795d 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,11 @@ +2002-01-28 Havoc Pennington + + * glib/gmarkup.c (add_attribute): NULL-terminate + context->attr_values so g_strfreev() is safe. + Would previously crash if parsing was ended prior + to ending the start tag. + (g_markup_parse_context_parse): add a couple assertions + 2002-01-28 Havoc Pennington * glib/gmacros.h: get rid of warning here diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index dff6a7836..f5583795d 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,11 @@ +2002-01-28 Havoc Pennington + + * glib/gmarkup.c (add_attribute): NULL-terminate + context->attr_values so g_strfreev() is safe. + Would previously crash if parsing was ended prior + to ending the start tag. + (g_markup_parse_context_parse): add a couple assertions + 2002-01-28 Havoc Pennington * glib/gmacros.h: get rid of warning here diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index dff6a7836..f5583795d 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,11 @@ +2002-01-28 Havoc Pennington + + * glib/gmarkup.c (add_attribute): NULL-terminate + context->attr_values so g_strfreev() is safe. + Would previously crash if parsing was ended prior + to ending the start tag. + (g_markup_parse_context_parse): add a couple assertions + 2002-01-28 Havoc Pennington * glib/gmacros.h: get rid of warning here diff --git a/glib/gmarkup.c b/glib/gmarkup.c index bf7ff376c..f20ee3681 100644 --- a/glib/gmarkup.c +++ b/glib/gmarkup.c @@ -732,6 +732,7 @@ add_attribute (GMarkupParseContext *context, char *name) context->attr_names[context->cur_attr] = name; context->attr_values[context->cur_attr] = NULL; context->attr_names[context->cur_attr+1] = NULL; + context->attr_values[context->cur_attr+1] = NULL; } /** @@ -1196,8 +1197,12 @@ g_markup_parse_context_parse (GMarkupParseContext *context, g_free (context->attr_values[pos]); context->attr_names[pos] = context->attr_values[pos] = NULL; } - context->cur_attr = -1; - + g_assert (context->cur_attr == -1); + g_assert (context->attr_names == NULL || + context->attr_names[0] == NULL); + g_assert (context->attr_values == NULL || + context->attr_values[0] == NULL); + if (tmp_error != NULL) { mark_error (context, tmp_error);