-/* $OpenBSD: packet.c,v 1.335 2026/04/13 08:18:33 job Exp $ */
+/* $OpenBSD: packet.c,v 1.336 2026/05/31 04:24:39 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
{
struct session_state *state;
const struct sshcipher *none = cipher_by_name("none");
- int r;
+ int r, wasnull = ssh == NULL;
if (none == NULL) {
error_f("cannot load cipher 'none'");
(r = cipher_init(&state->receive_context, none,
(const u_char *)"", 0, NULL, 0, CIPHER_DECRYPT)) != 0) {
error_fr(r, "cipher_init failed");
- free(ssh); /* XXX need ssh_free_session_state? */
+ if (wasnull)
+ free(ssh); /* XXX need ssh_free_session_state? */
return NULL;
}
state->newkeys[MODE_IN] = state->newkeys[MODE_OUT] = NULL;
-/* $OpenBSD: ssh.c,v 1.630 2026/04/02 07:50:55 djm Exp $ */
+/* $OpenBSD: ssh.c,v 1.631 2026/05/31 04:24:39 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
if (options.control_path != NULL) {
int sock;
if ((sock = muxclient(options.control_path)) >= 0) {
- ssh_packet_set_connection(ssh, sock, sock);
+ if (ssh_packet_set_connection(ssh, sock, sock) == NULL)
+ fatal("ssh_packet_set_connection failed");
ssh_packet_set_mux(ssh);
goto skip_connect;
}