mirror of
https://github.com/openssh/openssh-portable.git
synced 2026-11-06 05:16:43 +00:00
upstream: Move state sanity check to before potential use. CID
915536, ok djm@ OpenBSD-Commit-ID: e10cd1caf73663ca194b2c7f793a785892feb127
This commit is contained in:
1 parent
721ad09d84
commit
511fcdc77d
1 file changed
+4
-3
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: packet.c,v 1.349 2026/10/30 07:25:33 djm Exp $ */
|
||||
/* $OpenBSD: packet.c,v 1.350 2026/10/31 03:29:22 dtucker Exp $ */
|
||||
/*
|
||||
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
||||
@@ -3000,11 +3000,12 @@ sshpkt_protocol_error(struct ssh *ssh, const char *fmt,...)
|
||||
va_end(args);
|
||||
|
||||
logit("Disconnecting %s: %.100s", remote_id, buf);
|
||||
if (ssh->state == NULL)
|
||||
cleanup_exit(255); /* Can't poison? then exit */
|
||||
|
||||
if ((r = sshpkt_disconnect(ssh, "%s", buf)) != 0 ||
|
||||
(r = ssh_packet_write_wait(ssh)) != 0)
|
||||
return r;
|
||||
if (ssh->state == NULL)
|
||||
cleanup_exit(255); /* Can't poison? then exit */
|
||||
ssh->state->poisoned = 1;
|
||||
return SSH_ERR_PROTOCOL_ERROR;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user