- When parsing the reply to a CWD, PWD, or CDUP command, if we ran out of space in the destination buffer, we would correctly terminate the loop, but then incorrectly see the remaining length as non-zero, causing us to write a terminating NUL one past the end of the buffer and report success instead of a protocol error. Additionally, the code would fail to notice an improperly terminated pathname, and was hard to follow, so rewrite the entire loop.
- When comparing the current working directory to the intended working directory to calculate the minimal operation to get from one to the other, if the current working directory was an empty string, we would improperly read one byte below the start of the intended working directory.
MFC after: 1 week
Reported by: Laam Alif at ibteda.org