do not fail in strcasecmp(NULL)
authorJan Pospíšil <honik@ntc.zcu.cz>
Thu, 14 Jun 2007 14:34:57 +0000 (14:34 +0000)
committerJan Pospíšil <honik@ntc.zcu.cz>
Thu, 14 Jun 2007 14:34:57 +0000 (14:34 +0000)
org.glite.lb.common/src/events.c.T

index a0be7d6..9ce4022 100644 (file)
@@ -62,7 +62,7 @@ edg_wll_EventCode edg_wll_StringToEvent(const char *name)
        unsigned int    i;
 
        for (i=1; i<sizeof(eventNames)/sizeof(eventNames[0]); i++)
-               if (strcasecmp(eventNames[i],name) == 0) return (edg_wll_EventCode) i;
+               if ( (eventNames[i]) && (strcasecmp(eventNames[i],name) == 0)) return (edg_wll_EventCode) i;
        return EDG_WLL_EVENT_UNDEF;
 }