[openssl-commits] [openssl] master update

Rich Salz rsalz at openssl.org
Fri Feb 26 16:19:38 UTC 2016


The branch master has been updated
       via  acae59bb29ddc769743ab4a8ae373b5ff2f42b57 (commit)
      from  219f3ca61c2902425047974441d953e6042250ec (commit)


- Log -----------------------------------------------------------------
commit acae59bb29ddc769743ab4a8ae373b5ff2f42b57
Author: J Mohan Rao Arisankala <mohan at barracuda.com>
Date:   Wed Feb 24 13:03:10 2016 +0530

    EC_KEY_priv2buf (): check parameter sanity
    
    In EC_KEY_priv2buf(), check for pbuf sanity.
    If invoked with NULL, gracefully returns the key length.
    
    Signed-off-by: Rich Salz <rsalz at openssl.org>
    Reviewed-by: Matt Caswell <matt at openssl.org>

-----------------------------------------------------------------------

Summary of changes:
 crypto/ec/ec_key.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/crypto/ec/ec_key.c b/crypto/ec/ec_key.c
index c382e7e..439cfa2 100644
--- a/crypto/ec/ec_key.c
+++ b/crypto/ec/ec_key.c
@@ -583,8 +583,8 @@ size_t EC_KEY_priv2buf(const EC_KEY *eckey, unsigned char **pbuf)
     size_t len;
     unsigned char *buf;
     len = EC_KEY_priv2oct(eckey, NULL, 0);
-    if (len == 0)
-        return 0;
+    if (len == 0 || pbuf == NULL)
+        return len;
     buf = OPENSSL_malloc(len);
     if (buf == NULL)
         return 0;


More information about the openssl-commits mailing list