upstream: Check sshauthopt_new() for NULL. bz#3425, from

tessgauthier at microsoft.com.  ok djm@

OpenBSD-Commit-ID: af0315bc3e44aa406daa7e0ae7c2d719a974483f
This commit is contained in:
dtucker@openbsd.org 2022-04-26 07:41:44 +00:00 committed by Darren Tucker
parent d571314d14
commit 67b7c78476

5
auth.c
View File

@ -1,4 +1,4 @@
/* $OpenBSD: auth.c,v 1.154 2022/02/23 11:17:10 djm Exp $ */ /* $OpenBSD: auth.c,v 1.155 2022/04/26 07:41:44 dtucker Exp $ */
/* /*
* Copyright (c) 2000 Markus Friedl. All rights reserved. * Copyright (c) 2000 Markus Friedl. All rights reserved.
* *
@ -903,7 +903,8 @@ auth_restrict_session(struct ssh *ssh)
debug_f("restricting session"); debug_f("restricting session");
/* A blank sshauthopt defaults to permitting nothing */ /* A blank sshauthopt defaults to permitting nothing */
restricted = sshauthopt_new(); if ((restricted = sshauthopt_new()) == NULL)
fatal_f("sshauthopt_new failed");
restricted->permit_pty_flag = 1; restricted->permit_pty_flag = 1;
restricted->restricted = 1; restricted->restricted = 1;