Fix integer overflow in mbedtls_base64_decode()

Fix potential integer overflows in the function mbedtls_base64_decode().
This overflow would mainly be exploitable in 32-bit systems and could
cause buffer bound checks to be bypassed.
diff --git a/library/base64.c b/library/base64.c
index 7de87e5..3de67f0 100644
--- a/library/base64.c
+++ b/library/base64.c
@@ -198,7 +198,7 @@
         return( 0 );
     }
 
-    n = ( ( n * 6 ) + 7 ) >> 3;
+    n = ( 6 * ( n >> 3 ) ) + ( ( 6 * ( n & 0x7 ) + 7 ) >> 3 );
     n -= j;
 
     if( dst == NULL || *dlen < n )