summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Dankov <tryagain@navit-project.org>2016-01-02 02:08:41 +0300
committerMichael Dankov <tryagain@navit-project.org>2016-01-02 02:08:41 +0300
commit5b059191b8f8be55d9a3686906322b741054a0f7 (patch)
tree64049382a47a775501f4fb7a8f66c5cc2c347745
parenteac6b302b1cc900427f56d23931d3f70c229559b (diff)
downloadnavit-5b059191b8f8be55d9a3686906322b741054a0f7.tar.gz
Fix:core:Crash in country_search_new
Properly handle coutry search by attr_country_id to fix crash in internal gui when there's a gps fix and a map supporting attr_country_id such as Reiseplaner is active. Fixes #1337.
-rw-r--r--navit/country.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/navit/country.c b/navit/country.c
index 52f471e17..7d13e69e7 100644
--- a/navit/country.c
+++ b/navit/country.c
@@ -362,9 +362,10 @@ country_search_new(struct attr *search, int partial)
{
struct country_search *ret=g_new(struct country_search, 1);
ret->search=*search;
- ret->search.u.str=linguistics_casefold(ret->search.u.str);
- if (search->type != attr_country_id)
+ if (search->type != attr_country_id) {
+ ret->search.u.str=linguistics_casefold(ret->search.u.str);
ret->len=strlen(ret->search.u.str);
+ }
else
ret->len=0;
ret->partial=partial;