This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients Niclas Larsson, eric.smith, larry, python-dev, vstinner
Date 2020-09-28.22:08:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1601330926.12.0.0889584560728.issue41170@roundup.psfhosted.org>
In-reply-to
Content
"Use strnlen instead of strlen when the size i known" rationale was "This PR changes strlen to strnlen so no buffer overruns are made when there's no null terminator", but strlen() was not called whne the string was not null terminated.

Serhiy wrote that strnlen() can be faster and that can be slower... If the goal is an optimization, a benchmark should prove it (on at least one platform).
https://github.com/python/cpython/pull/21236#issuecomment-699609949
History
Date User Action Args
2020-09-28 22:08:46vstinnersetrecipients: + vstinner, larry, eric.smith, python-dev, Niclas Larsson
2020-09-28 22:08:46vstinnersetmessageid: <1601330926.12.0.0889584560728.issue41170@roundup.psfhosted.org>
2020-09-28 22:08:46vstinnerlinkissue41170 messages
2020-09-28 22:08:46vstinnercreate