[openssl-commits] [openssl] master update

Kurt Roeckx kurt at openssl.org
Wed May 25 19:20:12 UTC 2016


The branch master has been updated
       via  dc9887c0199f5b7579e7b82dd7910008e419816f (commit)
      from  223516eadcd6c896392f8915585a50934adb863d (commit)


- Log -----------------------------------------------------------------
commit dc9887c0199f5b7579e7b82dd7910008e419816f
Author: Kurt Roeckx <kurt at roeckx.be>
Date:   Tue May 24 21:32:01 2016 +0200

    Avoid creating an illegal pointer
    
    Found by tis-interpreter
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    
    GH: #1122

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

Summary of changes:
 crypto/asn1/a_int.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/crypto/asn1/a_int.c b/crypto/asn1/a_int.c
index d06d417..9c28c02 100644
--- a/crypto/asn1/a_int.c
+++ b/crypto/asn1/a_int.c
@@ -201,18 +201,18 @@ static size_t c2i_ibuf(unsigned char *b, int *pneg,
     /* Must be negative: calculate twos complement */
     if (b) {
         const unsigned char *from = p + plen - 1 + pad;
-        unsigned char *to = b + plen - 1;
+        unsigned char *to = b + plen;
         i = plen;
         while (*from == 0 && i) {
-            *to-- = 0;
+            *--to = 0;
             i--;
             from--;
         }
-        *to-- = (*from-- ^ 0xff) + 1;
+        *--to = (*from-- ^ 0xff) + 1;
         OPENSSL_assert(i != 0);
         i--;
         for (; i > 0; i--)
-            *to-- = *from-- ^ 0xff;
+            *--to = *from-- ^ 0xff;
     }
     return plen;
 }


More information about the openssl-commits mailing list