Since CPython is implemented in C, when it reads a line from stdin, if the line exceeds whatever is the default size given to the string being read by the interpreter, would it cause a buffer overflow or does Python handle it?
1 Answer
Python dynamically sizes the string; it's not vulnerable to an overflow (though if the input is huge, it could raise a MemoryError when it can't expand the buffer further).
Python reads the input in chunks, and grows the buffer if it fills the buffer without finding a newline before reading another chunk.
raw_inputhere, although I guess you'd also need to read about the GNUreadlinefunction too, sinceraw_inputuses that if it's available.