New submission from Serhiy Storchaka: The audioop module has some issues with an overflow.
1. It uses post-checks for an integer overflow. This means using an undefined behavior. 2. When the result truncated in case of overflow, -maxval used as minimal value. But real minimum value is less (-maxval - 1). This means not using full possible range and causes an odd result of some operations (for example add(b'\x80', '\x00', 1) returns b'\x81'). 3. Some operations (for example bias()) does not truncating and just overflow. 4. lin2lin() conversion from 4 to 4 (should do nothing) loses 16 lowest bits. ---------- components: Extension Modules messages: 177482 nosy: mark.dickinson, serhiy.storchaka priority: normal severity: normal stage: needs patch status: open title: audioop overflow issues type: behavior versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue16686> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com