]> asedeno.scripts.mit.edu Git - PuTTY.git/commit
Cope with REG_SZ data not having a trailing NUL.
authorSimon Tatham <anakin@pobox.com>
Sun, 7 Sep 2014 13:06:50 +0000 (13:06 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 7 Sep 2014 13:06:50 +0000 (13:06 +0000)
commit9fa5b9858c61e45fd2ad6b892018bb9b2740dd84
tree52171e7e53f5743fedb39a9110b6efb92968f9f0
parent92fba02d577557b7fc2bb15423906e570675b64e
Cope with REG_SZ data not having a trailing NUL.

A user points out that the person who writes a REG_SZ into the
registry can choose whether or not to NUL-terminate it properly, and
if they don't, RegQueryValueEx will retrieve it without the NUL. So if
someone does that to PuTTY's saved session data, then PuTTY may
retrieve nonsense strings.

Arguably this is the fault of whoever tampered with the saved session
data without doing it the same way we would have, but even so, there
ought to be some handling at our end other than silently returning the
wrong data, and putting the NUL back on seems more sensible than
complaining loudly.

[originally from svn r10215]
windows/winstore.c