summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_lib.c
diff options
context:
space:
mode:
authorbeck <>2001-06-22 00:03:44 +0000
committerbeck <>2001-06-22 00:03:44 +0000
commit38b6ff9e5294811c57541ad47940f8f8f41dc114 (patch)
tree402699541cee3cf3f2943b0384dbda7de534de70 /src/lib/libcrypto/bn/bn_lib.c
parentafae624d63e4e717c5bae8c7842a4712309f728f (diff)
downloadopenbsd-38b6ff9e5294811c57541ad47940f8f8f41dc114.tar.gz
openbsd-38b6ff9e5294811c57541ad47940f8f8f41dc114.tar.bz2
openbsd-38b6ff9e5294811c57541ad47940f8f8f41dc114.zip
openssl-engine-0.9.6a merge
Diffstat (limited to 'src/lib/libcrypto/bn/bn_lib.c')
-rw-r--r--src/lib/libcrypto/bn/bn_lib.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/libcrypto/bn/bn_lib.c b/src/lib/libcrypto/bn/bn_lib.c
index b6b0ce4b3c..7767d65170 100644
--- a/src/lib/libcrypto/bn/bn_lib.c
+++ b/src/lib/libcrypto/bn/bn_lib.c
@@ -62,6 +62,7 @@
62#endif 62#endif
63 63
64#include <assert.h> 64#include <assert.h>
65#include <limits.h>
65#include <stdio.h> 66#include <stdio.h>
66#include "cryptlib.h" 67#include "cryptlib.h"
67#include "bn_lcl.h" 68#include "bn_lcl.h"
@@ -319,6 +320,12 @@ BIGNUM *bn_expand2(BIGNUM *b, int words)
319 320
320 if (words > b->dmax) 321 if (words > b->dmax)
321 { 322 {
323 if (words > (INT_MAX/(4*BN_BITS2)))
324 {
325 BNerr(BN_F_BN_EXPAND2,BN_R_BIGNUM_TOO_LONG);
326 return NULL;
327 }
328
322 bn_check_top(b); 329 bn_check_top(b);
323 if (BN_get_flags(b,BN_FLG_STATIC_DATA)) 330 if (BN_get_flags(b,BN_FLG_STATIC_DATA))
324 { 331 {