don't access unallocated memory
authorDaniel Kouřil <kouril@ics.muni.cz>
Tue, 15 Jul 2008 10:18:06 +0000 (10:18 +0000)
committerDaniel Kouřil <kouril@ics.muni.cz>
Tue, 15 Jul 2008 10:18:06 +0000 (10:18 +0000)
org.glite.security.proxyrenewal/src/voms.c

index 367c4de..c8f2486 100644 (file)
@@ -133,7 +133,7 @@ create_voms_command(glite_renewal_core_context ctx, struct vomsdata *vd, struct
 
    attribs = (*voms_cert)->std;
 
-   if (strcmp (attribs[0]->role, "NULL") == 0 )
+   if (attribs[0]->role == NULL || strcmp (attribs[0]->role, "NULL") == 0 )
       ret = asprintf(command, "G%s", attribs[0]->group);
    else
       ret = asprintf(command, "B%s:%s", attribs[0]->group, attribs[0]->role);