[issue41170] Use strnlen instead of strlen when the size i known.

2020-09-28 Thread STINNER Victor
STINNER Victor added the comment: "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

[issue41170] Use strnlen instead of strlen when the size i known.

2020-09-28 Thread STINNER Victor
STINNER Victor added the comment: PR 21236 was closed by his author, can this issue be closed? -- nosy: +vstinner ___ Python tracker ___

[issue41170] Use strnlen instead of strlen when the size i known.

2020-07-01 Thread Larry Hastings
Larry Hastings added the comment: strnlen() isn't standard C, but an exciting new function strnlen_s() is, as of C11. https://en.cppreference.com/w/c/string/byte/strlen (At this rate, we should be able to code CPython using that standard in about 2030.) But! I found a 2005 thread on /.

[issue41170] Use strnlen instead of strlen when the size i known.

2020-06-30 Thread Eric V. Smith
New submission from Eric V. Smith : Is strnlen() supported by all of the compilers we care about? -- nosy: +eric.smith ___ Python tracker ___

[issue41170] Use strnlen instead of strlen when the size i known.

2020-06-30 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch nosy: +python-dev nosy_count: 1.0 -> 2.0 pull_requests: +20388 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21236 ___ Python tracker

[issue41170] Use strnlen instead of strlen when the size i known.

2020-06-30 Thread Niclas Larsson
Change by Niclas Larsson : -- components: C API nosy: Niclas Larsson priority: normal severity: normal status: open title: Use strnlen instead of strlen when the size i known. versions: Python 3.10 ___ Python tracker