Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Jul 2013 07:09:36 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r253834 - head/sbin/swapon
Message-ID:  <201307310709.r6V79aHd051643@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Wed Jul 31 07:09:35 2013
New Revision: 253834
URL: http://svnweb.freebsd.org/changeset/base/253834

Log:
  Make two buffer variables static for now.  It is not safe to
  reference stack memory after return.
  
  MFC after:	2 weeks

Modified:
  head/sbin/swapon/swapon.c

Modified: head/sbin/swapon/swapon.c
==============================================================================
--- head/sbin/swapon/swapon.c	Wed Jul 31 07:06:58 2013	(r253833)
+++ head/sbin/swapon/swapon.c	Wed Jul 31 07:09:35 2013	(r253834)
@@ -446,7 +446,7 @@ swap_on_off_md(const char *name, char *m
 	FILE *sfd;
 	int fd, mdunit, error;
 	const char *ret;
-	char mdpath[PATH_MAX], linebuf[PATH_MAX];
+	static char mdpath[PATH_MAX], linebuf[PATH_MAX];
 	char *p, *vnodefile;
 	size_t linelen;
 	u_long ul;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307310709.r6V79aHd051643>