Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Jul 2009 05:36:31 +0000 (UTC)
From:      Jamie Gritton <jamie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r195969 - stable/7/usr.sbin/jexec
Message-ID:  <200907300536.n6U5aVrM093284@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jamie
Date: Thu Jul 30 05:36:31 2009
New Revision: 195969
URL: http://svn.freebsd.org/changeset/base/195969

Log:
  Preset errno to zero before calling strtol(), so the check afterwards will
  be valid.  This is required since the malloc call from r195859 leaves
  errno in an unknown state.
  
  For STABLE-7 only, as CURRENT doesn't make this strtol call.
  
  Reported by:	Michael Butler
  Approved by:	bz (mentor)

Modified:
  stable/7/usr.sbin/jexec/jexec.c

Modified: stable/7/usr.sbin/jexec/jexec.c
==============================================================================
--- stable/7/usr.sbin/jexec/jexec.c	Thu Jul 30 00:57:54 2009	(r195968)
+++ stable/7/usr.sbin/jexec/jexec.c	Thu Jul 30 05:36:31 2009	(r195969)
@@ -248,6 +248,7 @@ main(int argc, char *argv[])
 	if (argc < 2)
 		usage();
 	if (strlen(argv[0]) > 0) {
+		errno = 0;
 		jid = (int)strtol(argv[0], NULL, 10);
 		if (errno)
 			err(1, "Unable to parse jail ID.");



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