The unified diff between revisions [92f17752..] 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 [2037276e561104c2b79850dd2db314efd8d125c7]
#    to [dd4d17bf1561349dc289fc05fc32b4522cbf0f3b]
#
============================================================
--- src/big_code.cpp	2037276e561104c2b79850dd2db314efd8d125c7
+++ src/big_code.cpp	dd4d17bf1561349dc289fc05fc32b4522cbf0f3b
@@ -1,6 +1,6 @@
 /*************************************************
 * BigInt Encoding/Decoding Source File           *
-* (C) 1999-2006 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)
             {