Rework keylist_update() to fix both a buffer-size limitation and a
memory leak.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9955 cda61777-01e9-0310-a592-d414129be87e
Invent a win_strerror() function which behaves as much like Unix
strerror as I can arrange, wrapping up all the ugly FormatMessage
nonsense and caching previously looked-up messages for reuse so that
callers can treat them as static.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9956 cda61777-01e9-0310-a592-d414129be87e
Report an error if deleting a random seed file fails.

(This has also required me to add a currently unused nonfatal() to
PuTTYgen, since although PuTTYgen won't actually try to delete
putty.rnd, it does link in winstore.c as a whole.)


git-svn-id: svn://svn.tartarus.org/sgt/putty@9957 cda61777-01e9-0310-a592-d414129be87e
Add a missing null pointer check in one of the dialog box functions.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9958 cda61777-01e9-0310-a592-d414129be87e
Another big batch of memory leak fixes, again mostly on error paths.
The most interesting one is printer_add_enum, which I've modified to
take a char ** rather than a char * so that it can both realloc its
input buffer _and_ return NULL to indicate error.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9959 cda61777-01e9-0310-a592-d414129be87e
Fix a double error handling goof in the winstore side of the jump list
support: transform_jumplist_registry should give its caller
dynamically allocated data if and only if it returns JUMPLISTREG_OK,
and get_jumplist_registry_entries should test the return value against
JUMPLISTREG_OK rather than a value from a totally different enum.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9960 cda61777-01e9-0310-a592-d414129be87e
Rationalise null pointer checks in both decode_codepage functions, so
that decode_codepage(NULL) and decode_codepage("") both return the
default character set.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9961 cda61777-01e9-0310-a592-d414129be87e
Add missing casts in arguments to ctype functions.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9962 cda61777-01e9-0310-a592-d414129be87e
Replace the type-checking COMPTR macro with my current idea of best
practice in type-check macros.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9963 cda61777-01e9-0310-a592-d414129be87e
Missing assert.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9964 cda61777-01e9-0310-a592-d414129be87e
Correct an inequality sign causing the bounds check in Windows
palette_set() to be bogus. Fortunately, this isn't exploitable through
the terminal emulator, because the palette escape sequence parser
contains its own bounds check before even calling palette_set().

While I'm at it, fix the same goof in the OS X version! That port is
more or less abandoned, but that's no excuse for leaving obviously
wrong code lying around.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9965 cda61777-01e9-0310-a592-d414129be87e
Increase FONT_MAXNO from 0x2f to 0x40, to ensure the fonts[] array
includes every possible combination of the font bitfields, in
particular ATTR_OEM|ATTR_NARROW.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9966 cda61777-01e9-0310-a592-d414129be87e
Remove the variable 'bufused', which came over from winnet.c in
mistaken cut and paste and is just a bug.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9967 cda61777-01e9-0310-a592-d414129be87e
Fix a few more memory and resource leaks.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9968 cda61777-01e9-0310-a592-d414129be87e
Add a bob script to do Coverity scanning.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9969 cda61777-01e9-0310-a592-d414129be87e
Back out r9964. I wasn't paying attention: every control is in the
byid tree but not all of them are in the byctrl tree.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9970 cda61777-01e9-0310-a592-d414129be87e