~vcs-imports/putty/trunk

Viewing all changes in revision 3739.

  • Committer: simon
  • Date: 2014-09-07 13:06:50 UTC
  • Revision ID: svn-v4:cda61777-01e9-0310-a592-d414129be87e:putty:10215
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.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: