-
-
Notifications
You must be signed in to change notification settings - Fork 33k
Closed
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirsprinttype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
_curses.window.instr
is meant to extract a string of characters between two positions and we have a maximum number of allowed characters which is 1023. However, this limit is not enforced, namely we do the following:
winnstr(self->win, rtn, Py_MIN(n, 1023));
IOW, we cannot return more than 1023 characters in a single API call. This should be documented and enforced at runtime, so that users may know that they need multiple API calls, or we should allocate heap memory instead (currently the buffer holding the output is allocated on the stack).
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
Metadata
Metadata
Assignees
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirsprinttype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
Status
Done