summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorBen Laurie <ben@openssl.org>2008-12-26 15:29:02 +0000
committerBen Laurie <ben@openssl.org>2008-12-26 15:29:02 +0000
commit5ceb595dfa7e0919c5e2e8c9b49a221731e2baf6 (patch)
tree7c274074c70ca0b400ed2f0ee48bd56bfb7cd3bd /crypto
parent44390fadc0b0b7e3a5649cd913b0cf0a3beac8f7 (diff)
pval must always be set when pk7_cb() does anything (Coverity ID 146).
Diffstat (limited to 'crypto')
-rw-r--r--crypto/pkcs7/pk7_asn1.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/crypto/pkcs7/pk7_asn1.c b/crypto/pkcs7/pk7_asn1.c
index a08e879ceb..b7ec2883cb 100644
--- a/crypto/pkcs7/pk7_asn1.c
+++ b/crypto/pkcs7/pk7_asn1.c
@@ -82,26 +82,23 @@ static int pk7_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
void *exarg)
{
ASN1_STREAM_ARG *sarg = exarg;
- PKCS7 *p7;
- if (pval)
- p7 = (PKCS7 *)*pval;
- else
- p7 = NULL;
+ PKCS7 **pp7 = (PKCS7 **)pval;
+
switch(operation)
{
case ASN1_OP_STREAM_PRE:
- if (PKCS7_stream(&sarg->boundary, p7) <= 0)
+ if (PKCS7_stream(&sarg->boundary, *pp7) <= 0)
return 0;
case ASN1_OP_DETACHED_PRE:
- sarg->ndef_bio = PKCS7_dataInit(p7, sarg->out);
+ sarg->ndef_bio = PKCS7_dataInit(*pp7, sarg->out);
if (!sarg->ndef_bio)
return 0;
break;
case ASN1_OP_STREAM_POST:
case ASN1_OP_DETACHED_POST:
- if (PKCS7_dataFinal(p7, sarg->ndef_bio) <= 0)
+ if (PKCS7_dataFinal(*pp7, sarg->ndef_bio) <= 0)
return 0;
break;