fuzzylogician / gmpy

Automatically exported from code.google.com/p/gmpy
GNU Lesser General Public License v3.0
0 stars 0 forks source link

a null dereference in mpfr.__floor__ #98

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. from math import floor
2. from gmpy2 import mpfr
3. floor(mpfr('inf'))
python would crash immediately.

What is the expected output?
mpfr('inf')
What do you see instead?
python crashes.

What version of the product are you using? On what operating system?
python3 with latest gmpy2 (downloaded last week) on windows 10

Please provide any additional information below.
'__floor__' receives 'PyObject *self' and 'PyObject *other', but never checks 
whether (NULL == other). the steps aforementioned cause a call to '__floor__' 
while indeed (NULL == other), but then the type of 'other' is checked, which 
results in a crash.

Original issue reported on code.google.com by thedrizz...@gmail.com on 13 Aug 2015 at 6:03

GoogleCodeExporter commented 8 years ago
I can reproduce the issue but I'm still thinking about the best way to fix the 
issue. It may be a few days before I have a correct fix.

Original comment by casevh on 14 Aug 2015 at 5:26

GoogleCodeExporter commented 8 years ago
I have released version 2.0.7 which fixes the bug. It is available at 
https://pypi.python.org/pypi/gmpy2

Thanks for the report!

Original comment by casevh on 20 Aug 2015 at 5:36