simon-git: putty (master): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Sun Aug 4 16:28:17 BST 2019
TL;DR:
efcf164a Fix enum_settings_next() to handle subkeys with 256 characters long names.
Repository: https://git.tartarus.org/simon/putty.git
On the web: https://git.tartarus.org/?p=simon/putty.git
Branch updated: master
Committer: Simon Tatham <anakin at pobox.com>
Date: 2019-08-04 16:28:17
commit efcf164abe29eaf3357a63219830af4a71058af4
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=efcf164abe29eaf3357a63219830af4a71058af4;hp=de78556689b7c5402e69d5ee59879063da56a2e5
Author: Nastasie Ion Octavian <nastasie.octavian at gmail.com>
Date: Sun Aug 4 11:18:46 2019 +0300
Fix enum_settings_next() to handle subkeys with 256 characters long names.
Set the initial buffer size to MAX_PATH + 1 (261). Increment e->i before
the function returns instead of incrementing it in the call to
RegEnumKey.
The initial buffer size was too small to fit a subkey with a 256
characters long name plus '\0', the first call to RegEnumKey would fail
with ERROR_MORE_DATA, sgrowarray would grow the buffer, and RegEnumKey
would be called again.
However, because e->i was incremented in the first RegEnumKey call, the
second call would get the next subkey and the subkey with the long name
would be skipped.
Saving a session with a 256 characters long name would trigger this
problem. The session would be saved in the registry, but Putty would not
be able to display it in the saved sessions list.
Pageant didn't have this problem since it uses a different function to get
the saved sessions and the size of the buffer used is MAX_PATH + 1. Pageant
and Putty would display slightly different lists of saved sessions.
windows/winstore.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
More information about the tartarus-commits
mailing list