Subject: bin/2219: rdate crashes when used with -a option
To: None <gnats-bugs@NetBSD.ORG>
From: None <abrown@eecs.harvard.edu>
List: netbsd-bugs
Date: 03/15/1996 22:02:03
>Number:         2219
>Category:       bin
>Synopsis:       rdate segfaults when called with -a option due to arg mismatch
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 15 22:35:01 1996
>Last-Modified:
>Originator:     Aaron Brown
>Organization:
Harvard University
>Release:        NetBSD-current 960224
>Environment:
SPARCstation 20, NetBSD/Sparc-sun4m
System: NetBSD virtual4 1.1A NetBSD 1.1A (PERFORMANCE) #3: Sun Feb 25 12:44:03 EST 1996 abrown@virtual4:/usr/src/sys/arch/sparc/compile/PERFORMANCE sparc


>Description:
	When called with the -a option (to use adjtime), rdate will often
	crash because there is a printf requiring two parameters while only
	one is passed.
>How-To-Repeat:
	Run rdate -a a few times, and it should core dump.
>Fix:
*** rdate.c	1996/02/24 19:53:19	1.1.1.3
--- rdate.c	1996/03/16 02:52:58
***************
*** 167,173 ****
  		if (slidetime)
  		    (void) fprintf(stdout, 
  				   "%s: adjust local clock by %d seconds\n",
! 				   adjustment);
  	}
  	return 0;
  }
--- 167,173 ----
  		if (slidetime)
  		    (void) fprintf(stdout, 
  				   "%s: adjust local clock by %d seconds\n",
! 				   argv[0], adjustment);
  	}
  	return 0;
  }
>Audit-Trail:
>Unformatted: