From bc9dff88f1ffeeeb6141d7fa017e2a2fd9e2f2f7 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Nov 12 2015 16:28:33 +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 6997b43..991e580 100644 --- a/src/submit-e.c +++ b/src/submit-e.c @@ -963,6 +963,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;