From 2882e96a5f22ebd0af5dfaf8617f7cff5a409512 Mon Sep 17 00:00:00 2001 From: Rob Percival Date: Wed, 24 Feb 2016 15:11:36 +0000 Subject: [PATCH] Fix for potential deferencing of null pointer in o2i_SCT_signature Reviewed-by: Ben Laurie Reviewed-by: Rich Salz --- crypto/ct/ct_oct.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto/ct/ct_oct.c b/crypto/ct/ct_oct.c index 6b6a6a7bc7..73fc61df2b 100644 --- a/crypto/ct/ct_oct.c +++ b/crypto/ct/ct_oct.c @@ -98,7 +98,7 @@ int o2i_SCT_signature(SCT *sct, const unsigned char **in, size_t len) { size_t siglen; size_t len_remaining = len; - const unsigned char *p = *in; + const unsigned char *p; if (sct->version != SCT_VERSION_V1) { CTerr(CT_F_O2I_SCT_SIGNATURE, CT_R_UNSUPPORTED_VERSION); @@ -116,6 +116,7 @@ int o2i_SCT_signature(SCT *sct, const unsigned char **in, size_t len) return -1; } + p = *in; /* Get hash and signature algorithm */ sct->hash_alg = *p++; sct->sig_alg = *p++; -- 2.40.0