New submission from Mark Dickinson <dicki...@gmail.com>:

_PyFloat_Pack4 does a double-to-float cast, without first checking that the 
value being converted is within the range of a float.  According to C99 
6.3.1.5p2, this results in undefined behaviour.  It should be fixed (probably 
via comparison with FLT_MAX before casting.)

np_float in the struct module also has this problem.

----------
assignee: mark.dickinson
messages: 109483
nosy: mark.dickinson
priority: normal
severity: normal
stage: needs patch
status: open
title: Undefined behaviour in _PyFloat_Pack4
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9190>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to