hcgpalm/FreeRDP — comment on commit ded92bc9cd7379d054428fb5042df0e3e5bfc111
File:  line 0
By adambprotiviti:

Ah, OK. I forgot about that other line.

So cbPassword, according to http://msdn.microsoft.com/en-us/library/cc240475(v=prot.10).aspx?ppud=4, is the length of the password, EXCLUDING the mandatory null terminator.

When you are not redirected (i.e., typing in your password on the command line), your password is treated as a unicode string, so when you get its length it will not include the null terminator.

When you are redirected (i.e., the server sends you back a password_cookie), this password cookie is treated as a BLOB, so when you get its length, it includes the null terminator (two bytes, 00 00). So we have to compensate for this when we tell it what the length of our password cookie is.

I will test this patch now.