1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-25 01:02:24 +00:00

Remove a segfault in bombout() macro: don't sk_close() the socket if

it's already NULL. The `Incorrect MAC' problem was causing
ssh2_rdpkt to bombout(), setting s to NULL, and then a secondary
bombout() was happening at the next level up, causing a segfault.

[originally from svn r909]
This commit is contained in:
Simon Tatham 2001-01-29 13:19:59 +00:00
parent 36644228e3
commit 6017418fca

5
ssh.c
View File

@ -19,8 +19,9 @@
if ((flags & FLAG_STDERR) && (flags & FLAG_VERBOSE)) \
fprintf(stderr, "%s\n", s); }
#define bombout(msg) ( ssh_state = SSH_STATE_CLOSED, sk_close(s), \
s = NULL, connection_fatal msg )
#define bombout(msg) ( ssh_state = SSH_STATE_CLOSED, \
(s ? sk_close(s), s = NULL : (void)0), \
connection_fatal msg )
#define SSH1_MSG_DISCONNECT 1 /* 0x1 */
#define SSH1_SMSG_PUBLIC_KEY 2 /* 0x2 */