From 27d8fe8612e8efad2ef5b8d3bae21336dadfb2cd Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Sep 08 2015 18:45:27 +0000 Subject: Fix a possible uninitialized memory read Fix an error where we might try to read from an uninitialized pointer when trying to determine if a CA helper produced any useful data. This might be the root cause of Red Hat bug #1260871. --- diff --git a/src/submit-e.c b/src/submit-e.c index 803cb28..5b2f9f8 100644 --- a/src/submit-e.c +++ b/src/submit-e.c @@ -973,6 +973,11 @@ cm_submit_e_start_or_resume(struct cm_store_ca *ca, state->done = cm_submit_e_done; state->delay = -1; estate = talloc_ptrtype(state, estate); + if (estate == NULL) { + talloc_free(state); + return NULL; + } + memset(estate, 0, sizeof(*estate)); estate->phase = running_helper; estate->ca = ca; estate->entry = entry;