Gracefully handle NULL as argument for enum_from_name()
authorTobias Brunner <tobias@strongswan.org>
Mon, 3 Jun 2013 16:45:57 +0000 (18:45 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 11 Jun 2013 09:03:13 +0000 (11:03 +0200)
src/libstrongswan/utils/enum.c

index 9b3c4d5..3db9a34 100644 (file)
@@ -47,7 +47,7 @@ int enum_from_name(enum_name_t *e, char *name)
 
                for (i = 0; i < count; i++)
                {
-                       if (strcaseeq(name, e->names[i]))
+                       if (name && strcaseeq(name, e->names[i]))
                        {
                                return e->first + i;
                        }