by ducaale on 2/18/22, 1:25 PM with 2 comments
by jepler on 2/18/22, 2:07 PM
* an untyped, unchecked region of memory is modeled by `let mut mem = Vec::<char>::new();`
* First, a fixed range of 16 bytes in mem is allocated for the password to be read
* Then the password to check against is allocated and stored in mem
* Then the input with embedded `'\0'`s is read into the range, without respecting the BUF_CAP
* Finally, the two regions within `mem` are compared for string equality
There were no unsafe operations, but an "undesired" result can occur.by mitghi on 2/20/22, 9:49 AM
It could be more interesting to have another buffer holding user input and then overflow it and corrupt the password buffer.
I am curious if that is possible without using unsafe?