summaryrefslogtreecommitdiff
path: root/gtk/gtkcelllayout.c
diff options
context:
space:
mode:
authorJohan Dahlin <jdahlin@async.com.br>2007-08-07 21:52:29 +0000
committerJohan Dahlin <johan@src.gnome.org>2007-08-07 21:52:29 +0000
commit12e1855bba344bd78ea6466a47b1705e7e46a000 (patch)
tree3496e0a466e9721bd1e9736ceb70ced663e679c7 /gtk/gtkcelllayout.c
parent923a1cf84eaa507e275b282193939258b714c946 (diff)
downloadgtk+-12e1855bba344bd78ea6466a47b1705e7e46a000.tar.gz
Do not assume that text is null-terminated as pointed out by Christopher
2007-08-07 Johan Dahlin <jdahlin@async.com.br> * gtk/gtkbuilderparser.c (text): * gtk/gtkcelllayout.c (attributes_text_element): * gtk/gtkliststore.c (list_store_text): Do not assume that text is null-terminated as pointed out by Christopher Fergeau svn path=/trunk/; revision=18592
Diffstat (limited to 'gtk/gtkcelllayout.c')
-rw-r--r--gtk/gtkcelllayout.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gtk/gtkcelllayout.c b/gtk/gtkcelllayout.c
index 970ec954df..a9b1c6f6c0 100644
--- a/gtk/gtkcelllayout.c
+++ b/gtk/gtkcelllayout.c
@@ -349,21 +349,25 @@ attributes_text_element (GMarkupParseContext *context,
AttributesSubParserData *parser_data = (AttributesSubParserData*)user_data;
glong l;
gchar *endptr;
-
+ gchar *string;
+
if (!parser_data->attr_name)
return;
errno = 0;
- l = strtol (text, &endptr, 0);
- if (errno || endptr == text)
+ string = g_strndup (text, text_len);
+ l = strtol (string, &endptr, 0);
+ if (errno || endptr == string)
{
g_set_error (error,
GTK_BUILDER_ERROR,
GTK_BUILDER_ERROR_INVALID_VALUE,
"Could not parse integer `%s'",
- text);
+ string);
+ g_free (string);
return;
}
+ g_free (string);
gtk_cell_layout_add_attribute (parser_data->cell_layout,
parser_data->renderer,