Message377633
"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 |
|
Date |
User |
Action |
Args |
2020-09-28 22:08:46 | vstinner | set | recipients:
+ vstinner, larry, eric.smith, python-dev, Niclas Larsson |
2020-09-28 22:08:46 | vstinner | set | messageid: <1601330926.12.0.0889584560728.issue41170@roundup.psfhosted.org> |
2020-09-28 22:08:46 | vstinner | link | issue41170 messages |
2020-09-28 22:08:46 | vstinner | create | |
|