summaryrefslogtreecommitdiff
path: root/navit/bookmarks.c
diff options
context:
space:
mode:
authorakashihi <akashihi@ffa7fe5e-494d-0410-b361-a75ebd5db220>2010-06-10 11:39:06 +0000
committerakashihi <akashihi@ffa7fe5e-494d-0410-b361-a75ebd5db220>2010-06-10 11:39:06 +0000
commitd055cf95337b737936f8e0ef0c14876047441691 (patch)
treeae268b7215b768d65ab733e06a256898a373184a /navit/bookmarks.c
parent4ce2430d575c1d078c1af5e57039a1f9f528908f (diff)
downloadnavit-svn-d055cf95337b737936f8e0ef0c14876047441691.tar.gz
Fix:core:Fixed possible memory corruption in bookmarks parser
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@3351 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/bookmarks.c')
-rw-r--r--navit/bookmarks.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/navit/bookmarks.c b/navit/bookmarks.c
index 33e3e25a..65571435 100644
--- a/navit/bookmarks.c
+++ b/navit/bookmarks.c
@@ -137,6 +137,7 @@ bookmarks_load_hash(struct bookmarks *this_) {
struct attr attr;
struct coord c;
char *pos,*finder;
+ char *copy_helper;
if (this_->mr) {
map_rect_destroy(this_->mr);
@@ -184,7 +185,9 @@ bookmarks_load_hash(struct bookmarks *this_) {
}
finder+=strlen(finder)+1;
}
- strcpy(b_item->label,finder);
+ copy_helper=strdup(finder);
+ free(b_item->label);
+ b_item->label=copy_helper;
b_item->parent=this_->current;
g_hash_table_insert(this_->bookmarks_hash,b_item->label,b_item);