On 1/14/07, Calvin Spealman <ironfroggy at gmail.com> wrote: > Is it a more general problem that null-terminated strings are used > with data from strings we specifically allow to contain null bytes? > Perhaps a migration of *FromString() to *FromStringAndSize() > functions, or taking Python string object pointers, would be a more > general solution to set as a goal, so this sort of thing can't crop up > down the road, again. Most of the time this is taken care of by the argument type codes passed to PyArg_ParseTuple() and friends. If you use 's' then it assumes the string is for consumption of C code that uses null-termination, and it checks that there are no null bytes. Try open("foo\0"). -- --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4