From 99d75e20060a9cce94a13acbc7ffa5c7c0db4b04 Mon Sep 17 00:00:00 2001 From: mdankov Date: Wed, 13 Aug 2014 17:02:39 +0000 Subject: Fix:core:Do not crash on attempt to retrive an attribute missing from object, with command interpreter. git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5868 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- navit/attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'navit/attr.c') diff --git a/navit/attr.c b/navit/attr.c index a47fc8a08..903bcc8f1 100644 --- a/navit/attr.c +++ b/navit/attr.c @@ -599,7 +599,7 @@ attr_data_size(struct attr *attr) if (attr->type == attr_none) return 0; if (attr->type >= attr_type_string_begin && attr->type <= attr_type_string_end) - return strlen(attr->u.str)+1; + return attr->u.str?strlen(attr->u.str)+1:0; if (attr->type >= attr_type_int_begin && attr->type <= attr_type_int_end) return sizeof(attr->u.num); if (attr->type >= attr_type_coord_geo_begin && attr->type <= attr_type_coord_geo_end) -- cgit v1.2.1