xstrdup environment variable used by ForwardAgent. bz#3328 from
authordtucker <dtucker@openbsd.org>
Sun, 8 Aug 2021 08:49:09 +0000 (08:49 +0000)
committerdtucker <dtucker@openbsd.org>
Sun, 8 Aug 2021 08:49:09 +0000 (08:49 +0000)
goetze at dovetail.com, ok djm@ deraadt@

usr.bin/ssh/ssh.c

index 30c7e30..1a553e8 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.565 2021/07/23 05:24:02 djm Exp $ */
+/* $OpenBSD: ssh.c,v 1.566 2021/08/08 08:49:09 dtucker Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1609,7 +1609,7 @@ main(int ac, char **av)
                                fatal("Invalid ForwardAgent environment variable name %s", cp);
                        }
                        if ((p = getenv(cp + 1)) != NULL)
-                               forward_agent_sock_path = p;
+                               forward_agent_sock_path = xstrdup(p);
                        else
                                options.forward_agent = 0;
                        free(cp);