aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/math/bigint/bigint.h
diff options
context:
space:
mode:
authorSimon Warta <[email protected]>2015-06-30 10:38:52 +0200
committerSimon Warta <[email protected]>2015-06-30 10:38:52 +0200
commitabe4c5c8d9b88aafa6f8b745f9100d4dbd754e20 (patch)
tree295eafb79cab7843888133abbad07fb983915520 /src/lib/math/bigint/bigint.h
parentb90187419f64b6d38d19c888985d58f902336677 (diff)
parent1de5fc1419add86884df97580d7a2e745ad43bff (diff)
Merge pull request #154 from webmaster128/bounds-fixes
Remainings fixes before Botan runs fine in debug mode
Diffstat (limited to 'src/lib/math/bigint/bigint.h')
-rw-r--r--src/lib/math/bigint/bigint.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/math/bigint/bigint.h b/src/lib/math/bigint/bigint.h
index 3f329c451..fed986882 100644
--- a/src/lib/math/bigint/bigint.h
+++ b/src/lib/math/bigint/bigint.h
@@ -278,7 +278,11 @@ class BOTAN_DLL BigInt
if(top_word < size())
{
- clear_mem(&m_reg[top_word+1], size() - (top_word + 1));
+ const auto len = size() - (top_word + 1);
+ if (len > 0)
+ {
+ clear_mem(&m_reg[top_word+1], len);
+ }
m_reg[top_word] &= mask;
}
}