From 501ae846cee769ba8791a980f397ec33d960f7cd Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 17 Jun 2014 09:13:53 +0000 Subject: [PATCH] * libc/rexec.cc (cygwin_rexec): Make ahostbuf static to avoid returning an out-of-scope address. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/libc/rexec.cc | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 9970f94de..58f100129 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2014-05-24 David Stacey + + * libc/rexec.cc (cygwin_rexec): Make ahostbuf static to avoid returning + an out-of-scope address. + 2014-06-16 Corinna Vinschen * fhandler_socket.cc (fhandler_socket::evaluate_events): Call diff --git a/winsup/cygwin/libc/rexec.cc b/winsup/cygwin/libc/rexec.cc index d5548bf15..c3074d381 100644 --- a/winsup/cygwin/libc/rexec.cc +++ b/winsup/cygwin/libc/rexec.cc @@ -317,7 +317,7 @@ cygwin_rexec (char **ahost, unsigned short rport, char *name, char *pass, u_short port = 0; int s, timo = 1, s3; char c; - char ahostbuf[INTERNET_MAX_HOST_NAME_LENGTH + 1]; + static char ahostbuf[INTERNET_MAX_HOST_NAME_LENGTH + 1]; myfault efault; if (efault.faulted (EFAULT))