commit | 2d56a827ccf8d693db34f4cdb37202f34fb4048f | [log] [tgz] |
---|---|---|
author | Simon Butcher <simon.butcher@arm.com> | Thu Feb 02 08:46:53 2017 +0000 |
committer | Simon Butcher <simon.butcher@arm.com> | Thu Feb 02 09:17:41 2017 +0000 |
tree | df55577dd19e0a17aac5ec931e76efe5131d1aed | |
parent | 8cf6d31f548bb5ad306ea51a50e8adc401b04f1b [diff] |
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 3de67f0..ba69260 100644 --- a/library/base64.c +++ b/library/base64.c
@@ -198,6 +198,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;