commit | 2b912b4eeae645fe917093f884a0c52e9bce6ec7 | [log] [tgz] |
---|---|---|
author | Simon Butcher <simon.butcher@arm.com> | Thu Feb 02 08:46:53 2017 +0000 |
committer | Simon Butcher <simon.butcher@arm.com> | Mon Feb 20 21:51:18 2017 +0000 |
tree | 9856ebcfec995a698c95854254fe0e129b00d59a | |
parent | d00d3e250e201f8fae9330bce1a5e321cb84aaa5 [diff] [blame] |
Add comment to integer overflow fix in base64.c Adds clarifying comment to the integer overflow fix in base64.c
diff --git a/library/base64.c b/library/base64.c index d4fdf6e..4ed6b31 100644 --- a/library/base64.c +++ b/library/base64.c
@@ -192,6 +192,10 @@ 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 -= j;