svn commit: r195969 - stable/7/usr.sbin/jexec

Jamie Gritton jamie at FreeBSD.org
Thu Jul 30 05:36:32 UTC 2009


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.");


More information about the svn-src-stable-7 mailing list