-/* $OpenBSD: auth-passwd.c,v 1.44 2014/07/15 15:54:14 millert Exp $ */
+/* $OpenBSD: auth-passwd.c,v 1.45 2016/07/21 01:39:35 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#define DAY (24L * 60 * 60) /* 1 day in seconds */
#define TWO_WEEKS (2L * 7 * DAY) /* 2 weeks in seconds */
+#define MAX_PASSWORD_LEN 1024
+
static void
disable_forwarding(void)
{
struct passwd * pw = authctxt->pw;
int ok = authctxt->valid;
+ if (strlen(password) > MAX_PASSWORD_LEN)
+ return 0;
+
if (pw->pw_uid == 0 && options.permit_root_login != PERMIT_YES)
ok = 0;
if (*password == '\0' && options.permit_empty_passwd == 0)