upstream: Make a copy of the user when handling ssh -l, so that

later during User token expansion we don't end up freeing a member of argv.
Spotted by anton@'s regress tests.

OpenBSD-Commit-ID: 2f671a4f5726b66d123b88b1fdd1a90581339955
This commit is contained in:
dtucker@openbsd.org
2025-03-02 07:02:49 +00:00
committed by Damien Miller
parent bd30cf784d
commit 65d2c59628

4
ssh.c
View File

@@ -1,4 +1,4 @@
/* $OpenBSD: ssh.c,v 1.606 2025/03/01 06:11:26 dtucker Exp $ */
/* $OpenBSD: ssh.c,v 1.607 2025/03/02 07:02:49 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1025,7 +1025,7 @@ main(int ac, char **av)
break;
case 'l':
if (options.user == NULL)
options.user = optarg;
options.user = xstrdup(optarg);
break;
case 'L':