Fix for potential deferencing of null pointer in o2i_SCT_signature
authorRob Percival <robpercival@google.com>
Wed, 24 Feb 2016 15:11:36 +0000 (15:11 +0000)
committerRich Salz <rsalz@openssl.org>
Fri, 26 Feb 2016 19:57:29 +0000 (14:57 -0500)
Reviewed-by: Ben Laurie <ben@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
crypto/ct/ct_oct.c

index 6b6a6a7..73fc61d 100644 (file)
@@ -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++;