New submission from Xiang Zhang:

Here is a drawback in validate_step of rangeobject. PyNumber_AsSsize_t returns 
clipped value and won't set an exception when the argument *exc* is set NULL. 
So if step overflows, istep is always PY_SSIZE_MAX or PY_SSIZE_MIN. But the 
following code is to check if istep is -1 and there is an exception. The code 
actually conflicts. But fortunately the result is always right. I suggest to 
make the code logic right.

----------
files: incorrect_logic_in_validate_step.patch
keywords: patch
messages: 268677
nosy: xiang.zhang
priority: normal
severity: normal
status: open
title: validate_step in rangeobject.c, incorrect code logic but right result
Added file: 
http://bugs.python.org/file43419/incorrect_logic_in_validate_step.patch

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

Reply via email to