From: dtucker@openbsd.org Date: Sun, 2 Mar 2025 07:02:49 +0000 (+0000) Subject: upstream: Make a copy of the user when handling ssh -l, so that X-Git-Tag: V_10_0_P1~58 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=65d2c59628e68e166046efa69e76c1d395a8df6e;p=thirdparty%2Fopenssh-portable.git 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 --- diff --git a/ssh.c b/ssh.c index f6505b03a..7efa863b4 100644 --- a/ssh.c +++ b/ssh.c @@ -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 * Copyright (c) 1995 Tatu Ylonen , 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':