[openssl-commits] [openssl] master update

Kurt Roeckx kurt at openssl.org
Fri Jun 24 16:22:00 UTC 2016


The branch master has been updated
       via  5bea15ebb359c91a1bb7569620ead14bb71cfb81 (commit)
      from  24bf6f3c7fccd91b5a9d3ab722c712ef4b0530f9 (commit)


- Log -----------------------------------------------------------------
commit 5bea15ebb359c91a1bb7569620ead14bb71cfb81
Author: Kurt Roeckx <kurt at roeckx.be>
Date:   Thu Jun 23 09:37:51 2016 +0200

    Avoid signed overflow
    
    Found by afl
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    
    MR: #3013

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

Summary of changes:
 crypto/asn1/x_long.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/asn1/x_long.c b/crypto/asn1/x_long.c
index 9d27ba4..0af7875 100644
--- a/crypto/asn1/x_long.c
+++ b/crypto/asn1/x_long.c
@@ -128,8 +128,8 @@ static int long_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
     }
     ltmp = (long)utmp;
     if (neg) {
-        ltmp++;
         ltmp = -ltmp;
+        ltmp--;
     }
     if (ltmp == it->size) {
         ASN1err(ASN1_F_LONG_C2I, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG);


More information about the openssl-commits mailing list