msg278202 - (view) |
Author: Xiang Zhang (xiang.zhang) *  |
Date: 2016-10-06 18:15 |
Currently PyUnicode_CopyCharacters doesn't check arguments thoroughly. This could lead to undefined behaviour or crash in debug mode. For example, from_start > len(from), how_many < 0. Another case is that when how_many > len(from), it will choose len(from) but this can still fail since from_start can > 0. The doc of it is also not perfect, it does not necessarily return 0 on success. |
|
|
msg278205 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2016-10-06 19:08 |
Added comments on Rietveld. I don't know whether tests for this function are needed. It is public, but is not a part of stable API. |
|
|
msg278240 - (view) |
Author: Xiang Zhang (xiang.zhang) *  |
Date: 2016-10-07 13:14 |
v2 applies Serhiy's suggestions. |
|
|
msg278322 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2016-10-08 19:48 |
New changeset 13addd71b751 by Serhiy Storchaka in branch '3.5': Issue #28379: Added sanity checks and tests for PyUnicode_CopyCharacters(). https://hg.python.org/cpython/rev/13addd71b751 |
|
|
msg278323 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2016-10-08 19:50 |
Thank you for your contribution. |
|
|
msg278342 - (view) |
Author: Xiang Zhang (xiang.zhang) *  |
Date: 2016-10-09 04:41 |
Thanks Serhiy! But sorry I think I have made a mistake. In unicode_copycharacters we don't need PyUnicode_READY since it has been done in argument parse. Could you remove it? |
|
|
msg278356 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2016-10-09 12:38 |
New changeset 1be8cd7cee92 by Serhiy Storchaka in branch 'default': Issue #28379: Removed redundant check. https://hg.python.org/cpython/rev/1be8cd7cee92 |
|
|
msg278359 - (view) |
Author: Xiang Zhang (xiang.zhang) *  |
Date: 2016-10-09 13:31 |
We don't need to remove it for 3.5 and 3.6? |
|
|
msg278373 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2016-10-09 16:54 |
This is just a cleaning up of not very important code. |
|
|
msg278374 - (view) |
Author: Xiang Zhang (xiang.zhang) *  |
Date: 2016-10-09 17:00 |
Fine. :-) |
|
|