mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-02 09:04:28 +01:00
Add comment to integer overflow fix in base64.c
Adds clarifying comment to the integer overflow fix in base64.c
This commit is contained in:
parent
a540090142
commit
9df03441d0
@ -192,6 +192,10 @@ int mbedtls_base64_decode( unsigned char *dst, size_t dlen, size_t *olen,
|
|||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* The following expression is to calculate the following formula without
|
||||||
|
* risk of integer overflow in n:
|
||||||
|
* n = ( ( n * 6 ) + 7 ) >> 3;
|
||||||
|
*/
|
||||||
n = ( 6 * ( n >> 3 ) ) + ( ( 6 * ( n & 0x7 ) + 7 ) >> 3 );
|
n = ( 6 * ( n >> 3 ) ) + ( ( 6 * ( n & 0x7 ) + 7 ) >> 3 );
|
||||||
n -= j;
|
n -= j;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user