[openssh-commits] [openssh] branch master updated: upstream: avoid possible NULL deref if

git+noreply at mindrot.org git+noreply at mindrot.org
Tue Dec 30 15:24:32 AEDT 2025


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

The following commit(s) were added to refs/heads/master by this push:
     new 5f2bc9cb8 upstream: avoid possible NULL deref if
5f2bc9cb8 is described below

commit 5f2bc9cb8625d1fd582e0e4b562200f9856f1f7d
Author: djm at openbsd.org <djm at openbsd.org>
AuthorDate: Tue Dec 30 04:23:53 2025 +0000

    upstream: avoid possible NULL deref if
    
    ssh_packet_check_rekey_blocklimit() called before the encrypted transport is
    brought up.
    
    OpenBSD-Commit-ID: fb998ccbe59865e33a8ab6a6577f254d39bdc72f
---
 packet.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/packet.c b/packet.c
index 1c781763c..3d47df758 100644
--- a/packet.c
+++ b/packet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.329 2025/12/30 00:35:37 djm Exp $ */
+/* $OpenBSD: packet.c,v 1.330 2025/12/30 04:23:53 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -1096,6 +1096,9 @@ ssh_packet_check_rekey_blocklimit(struct ssh *ssh, u_int packet_len, int hard)
 	    state->p_read.packets > MAX_PACKETS)
 		return 1;
 
+	if (state->newkeys == NULL)
+		return 0;
+
 	/* Rekey after (cipher-specific) maximum blocks */
 	out_blocks = ROUNDUP(packet_len,
 	    state->newkeys[MODE_OUT]->enc.block_size);

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list