I have been slightly confused by the way a common python function available called raw_input operates.
I don't appear to have any restrictions to input however many chars I want here . The function help also does not appear to ask for a maximum number of characters as an argument as shown below (it only allows user to enter a prompt message).
raw_input(...)
raw_input([prompt]) -> string
Read a string from standard input. The trailing newline is stripped. If the user hits EOF (Unix: Ctl-D, Windows: Ctl-Z+Return), raise EOFError.On Unix, GNU readline is used if enabled. The prompt string, if given, is printed without a trailing newline before reading.
How does Python stop a buffer overflow attack or any attempt to consume excessive memory in a scenario where data is read in from user as a string - which is basically an array of chars - as shown below???
>> r=raw_input("enter something:")
enter something: dfjdfldfkdflkjdflkdjflkjfdlfdjklfdkjfdlkjfdlkfjdlkdfjlfdj.....
>> print r
dfjdfldfkdflkjdflkdjflkjfdlfdjklfdkjfdlkjfdlkfjdlkdfjlfdj.....
Thanks and Kind Regards,
John