diff options
author | Torbjorn Granlund <tege@gmplib.org> | 2014-01-19 13:10:19 +0100 |
---|---|---|
committer | Torbjorn Granlund <tege@gmplib.org> | 2014-01-19 13:10:19 +0100 |
commit | f6696ef00801604812cddeacfcc71c5cbe6706dc (patch) | |
tree | 47d61819dae9278546c41dec4271662ca55e96be /mpf/iset.c | |
parent | 548dda66b59dfd7f131c3801100b3af008323ef0 (diff) | |
download | gmp-f6696ef00801604812cddeacfcc71c5cbe6706dc.tar.gz |
Avoid overflow in allocation computation.
Diffstat (limited to 'mpf/iset.c')
-rw-r--r-- | mpf/iset.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mpf/iset.c b/mpf/iset.c index 969032950..6a06543d6 100644 --- a/mpf/iset.c +++ b/mpf/iset.c @@ -28,7 +28,7 @@ mpf_init_set (mpf_ptr r, mpf_srcptr s) mp_size_t prec; prec = __gmp_default_fp_limb_precision; - r->_mp_d = (mp_ptr) (*__gmp_allocate_func) ((prec + 1) * BYTES_PER_MP_LIMB); + r->_mp_d = (mp_ptr) (*__gmp_allocate_func) ((size_t) (prec + 1) * BYTES_PER_MP_LIMB); r->_mp_prec = prec; prec++; /* lie not to lose precision in assignment */ |