avoid accessing uninitialized memory
authorDaniel Kouřil <kouril@ics.muni.cz>
Tue, 24 Jun 2008 14:20:42 +0000 (14:20 +0000)
committerDaniel Kouřil <kouril@ics.muni.cz>
Tue, 24 Jun 2008 14:20:42 +0000 (14:20 +0000)
org.glite.lb.client/src/prod_proto.c

index 1a2a3f8..4a129c9 100644 (file)
@@ -254,7 +254,8 @@ int edg_wll_log_connect(edg_wll_Context ctx, int *conn)
                edg_wll_SetErrorGss(ctx, "edg_wll_gss_acquire_cred_gsi(): failed to load GSI credentials", &gss_stat);
                goto edg_wll_log_connect_err;
        }
-       my_subject_name = ctx->connections->connPool[index].gsiCred->name;
+       if (ctx->connections->connPool[index].gsiCred)
+               my_subject_name = ctx->connections->connPool[index].gsiCred->name;
         
 #ifdef EDG_WLL_LOG_STUB
        if (my_subject_name != NULL) {
@@ -282,7 +283,8 @@ int edg_wll_log_connect(edg_wll_Context ctx, int *conn)
                answer = edg_wll_SetErrorGss(ctx, "edg_wll_gss_acquire_cred_gsi(): failed to load GSI credentials", &gss_stat);
                goto edg_wll_log_connect_err;
        }
-       my_subject_name = ctx->connections->connPool[index].gsiCred->name;
+       if (ctx->connections->connPool[index].gsiCred)
+               my_subject_name = ctx->connections->connPool[index].gsiCred->name;
 
 #ifdef EDG_WLL_LOG_STUB
        if (my_subject_name != NULL) {