This assumes that tile numbers are at most 3 characters long, which isn't the
case. Resulting in "g_sprintf (value, "%d", number);" corrupting the stack and
causing the segfault.
return network_map_source;
}
+#define SIZE 8
gchar *
champlain_network_map_source_get_tile_uri (ChamplainNetworkMapSource *network_map_source,
gint x,
while (token != NULL)
{
gint number = G_MAXINT;
- gchar value[3];
+ gchar value[SIZE];
if (strcmp (token, "X") == 0)
number = x;
if (number != G_MAXINT)
{
- g_sprintf (value, "%d", number);
+ g_snprintf (value, SIZE, "%d", number);
g_string_append (ret, value);
}
else