3 ms·
Some commentary would have helped me. I don't read (or write) rust but my understanding: * an untyped, unchecked region of memory is modeled by `let mut me
by jepler 5y ago
Some commentary would have helped me. I don't read (or write) rust but my understanding:
* 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.