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.");
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to