(no title)
zlynx | 4 years ago
Memory map a read/write page and after that memory map a no-permissions guard page. Now you can safely use gets() to read a page size string without allowing a buffer overflow.
zlynx | 4 years ago
Memory map a read/write page and after that memory map a no-permissions guard page. Now you can safely use gets() to read a page size string without allowing a buffer overflow.
kevincox|4 years ago
I think the only safe way to use gets() is with trusted input.
Arnavion|4 years ago
Edit: I guess you're considering "used safely" to include reading a truncated string, in which case writing in order would allow the program to be written such that it recovers from the fault and reads the valid page-worth of string.
gpm|4 years ago
Denvercoder9|4 years ago