[openssl-commits] [openssl] master update
Matt Caswell
matt at openssl.org
Wed Jun 8 14:31:53 UTC 2016
The branch master has been updated
via 01d0e241dc4184a5a1f222f8eccdad11da12305a (commit)
from e2bb9b9bf355792d89e131518cc0fd141d46ca5c (commit)
- Log -----------------------------------------------------------------
commit 01d0e241dc4184a5a1f222f8eccdad11da12305a
Author: Kurt Cancemi <kurt at x64architecture.com>
Date: Thu May 26 16:38:31 2016 -0400
crypto/x509/x509_vpm.c: Simplify int_x509_param_set1()
This change also avoids calling strlen twice when srclen is 0
Reviewed-by: Rich Salz <rsalz at openssl.org>
Reviewed-by: Matt Caswell <matt at openssl.org>
-----------------------------------------------------------------------
Summary of changes:
crypto/x509/x509_vpm.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/crypto/x509/x509_vpm.c b/crypto/x509/x509_vpm.c
index f7ecdec..194d09b 100644
--- a/crypto/x509/x509_vpm.c
+++ b/crypto/x509/x509_vpm.c
@@ -259,12 +259,11 @@ static int int_x509_param_set1(char **pdest, size_t *pdestlen,
{
void *tmp;
if (src) {
- if (srclen == 0) {
- tmp = OPENSSL_strdup(src);
+ if (srclen == 0)
srclen = strlen(src);
- } else
- tmp = OPENSSL_memdup(src, srclen);
- if (!tmp)
+
+ tmp = OPENSSL_memdup(src, srclen);
+ if (tmp == NULL)
return 0;
} else {
tmp = NULL;
@@ -272,7 +271,7 @@ static int int_x509_param_set1(char **pdest, size_t *pdestlen,
}
OPENSSL_free(*pdest);
*pdest = tmp;
- if (pdestlen)
+ if (pdestlen != NULL)
*pdestlen = srclen;
return 1;
}
More information about the openssl-commits
mailing list