The unified diff between revisions [5ac60dc5..] and [11a5f681..] is displayed below. It can also be downloaded as a raw diff.
This diff has been restricted to the following files: 'src/big_code.cpp'
#
#
# patch "src/big_code.cpp"
# from [5b8575b75382b660b9091d177312cd6ae5cd112b]
# to [dd4d17bf1561349dc289fc05fc32b4522cbf0f3b]
#
============================================================
--- src/big_code.cpp 5b8575b75382b660b9091d177312cd6ae5cd112b
+++ src/big_code.cpp dd4d17bf1561349dc289fc05fc32b4522cbf0f3b
@@ -1,6 +1,6 @@
/*************************************************
* BigInt Encoding/Decoding Source File *
-* (C) 1999-2007 The Botan Project *
+* (C) 1999-2007 Jack Lloyd *
*************************************************/
#include <botan/bigint.h>
@@ -124,6 +124,13 @@ BigInt BigInt::decode(const byte buf[],
const u32bit RADIX = ((base == Decimal) ? 10 : 8);
for(u32bit j = 0; j != length; ++j)
{
+ if(Charset::is_space(buf[j]))
+ continue;
+
+ if(!Charset::is_digit(buf[j]))
+ throw Invalid_Argument("BigInt::decode: "
+ "Invalid character in decimal input");
+
byte x = Charset::char2digit(buf[j]);
if(x >= RADIX)
{