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_ui.c | |
parent | 548dda66b59dfd7f131c3801100b3af008323ef0 (diff) | |
download | gmp-f6696ef00801604812cddeacfcc71c5cbe6706dc.tar.gz |
Avoid overflow in allocation computation.
Diffstat (limited to 'mpf/iset_ui.c')
-rw-r--r-- | mpf/iset_ui.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mpf/iset_ui.c b/mpf/iset_ui.c index 58aaa1c85..c35db53c7 100644 --- a/mpf/iset_ui.c +++ b/mpf/iset_ui.c @@ -27,7 +27,7 @@ mpf_init_set_ui (mpf_ptr r, unsigned long int val) mp_size_t size; r->_mp_prec = prec; - 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_d[0] = val & GMP_NUMB_MASK; size = (val != 0); |