Fix:Maptool:Fix coverity bug #43. Dereferencing NULL value "attr"
authorhorwitz <horwitz@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Thu, 18 Mar 2010 09:08:17 +0000 (09:08 +0000)
committerhorwitz <horwitz@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Thu, 18 Mar 2010 09:08:17 +0000 (09:08 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@3046 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/gui/internal/gui_internal.c

index 5a5c73e..d2dd821 100644 (file)
@@ -3624,6 +3624,10 @@ gui_internal_add_vehicle_profile(struct gui_priv *this, struct widget
 
        // Figure out the profile name
        attr = attr_search(profile->attrs, NULL, attr_name);
+       if (!attr) {
+               dbg(0, "Adding vehicle profile failed. attr==NULL");
+               return;
+       }
        name = attr->u.str;
 
        // Determine whether the profile is the active one