upstream: allow sshd_config longer than 256k; ok djm

OpenBSD-Commit-ID: 83f40dd5457a64c1d3928eb4364461b22766beb3
This commit is contained in:
markus@openbsd.org 2020-06-24 15:08:53 +00:00 committed by Damien Miller
parent e3fa6249e6
commit 89b54900ac
1 changed files with 2 additions and 2 deletions

4
msg.c
View File

@ -1,4 +1,4 @@
/* $OpenBSD: msg.c,v 1.18 2020/01/22 04:49:16 djm Exp $ */ /* $OpenBSD: msg.c,v 1.19 2020/06/24 15:08:53 markus Exp $ */
/* /*
* Copyright (c) 2002 Markus Friedl. All rights reserved. * Copyright (c) 2002 Markus Friedl. All rights reserved.
* *
@ -77,7 +77,7 @@ ssh_msg_recv(int fd, struct sshbuf *m)
return (-1); return (-1);
} }
msg_len = get_u32(buf); msg_len = get_u32(buf);
if (msg_len > 256 * 1024) { if (msg_len > sshbuf_max_size(m)) {
error("%s: read: bad msg_len %u", __func__, msg_len); error("%s: read: bad msg_len %u", __func__, msg_len);
return (-1); return (-1);
} }