diff options
author | Stefan Wildemann <metalstrolch@users.noreply.github.com> | 2019-10-30 00:23:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-30 00:23:40 +0100 |
commit | df2c55b4d9c334bcc5f74d4d0b456d8e3685c3d1 (patch) | |
tree | 1b07a6d3795c27777bccf388b8effd42243b1a68 /navit/item.h | |
parent | c0a7ca3b532251ef0334f84c17a19274f501969c (diff) | |
download | navit-df2c55b4d9c334bcc5f74d4d0b456d8e3685c3d1.tar.gz |
fix:core:Don't flood stack on big map elements (#928)
* fix:core:Don't flood stack on big map elements
Use g_malloc instead of g_alloca on huge map elements.
Correctly calculate element intersection with map selection
even if buffer is too small.
Diffstat (limited to 'navit/item.h')
-rw-r--r-- | navit/item.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/navit/item.h b/navit/item.h index 0d0e84c7f..26c83cd72 100644 --- a/navit/item.h +++ b/navit/item.h @@ -83,6 +83,7 @@ struct item_methods { int (*item_attr_set)(void *priv_data, struct attr *attr, enum change_mode mode); int (*item_coord_set)(void *priv_data, struct coord *c, int count, enum change_mode mode); int (*item_type_set)(void *priv_data, enum item_type type); + int (*item_coords_left)(void *priv_data); }; struct item_id { @@ -127,6 +128,7 @@ void item_create_hash(void); void item_destroy_hash(void); int *item_get_default_flags(enum item_type type); void item_coord_rewind(struct item *it); +int item_coords_left(struct item * it); int item_coord_get(struct item *it, struct coord *c, int count); int item_coord_set(struct item *it, struct coord *c, int count, enum change_mode mode); int item_coord_get_within_selection(struct item *it, struct coord *c, int count, struct map_selection *sel); |