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
commita410c6f7a061e87e16373a803e2c93f672ef3d96 (patch)
treeae268b7215b768d65ab733e06a256898a373184a /navit/bookmarks.c
parent3d2c1bc66eff7981925819f9dfac4e142603d1d1 (diff)
downloadnavit-a410c6f7a061e87e16373a803e2c93f672ef3d96.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 33e3e25af..65571435b 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);