[2683] in Kerberos-V5-bugs

home help back first fref pref prev next nref lref last post

Re: krb5-admin/386: Password history doesn't work unless there are already old keys

daemon@ATHENA.MIT.EDU (Theodore Y. Ts'o)
Fri Mar 7 17:31:35 1997

Date: Fri, 7 Mar 1997 17:27:26 -0500
From: "Theodore Y. Ts'o" <tytso@MIT.EDU>
To: krb5-bugs@MIT.EDU, kenh@cmf.nrl.navy.mil
Cc: bjaspan@MIT.EDU, gnats-admin@RT-11.MIT.EDU, krb5-prs@RT-11.MIT.EDU
In-Reply-To: Ken Hornstein's message of Fri, 7 Mar 1997 16:56:02 -0500,
	<199703072156.QAA01929@rt-11.MIT.EDU>

   Date: Fri, 7 Mar 1997 16:55:32 -0500 (EST)
   From: Ken Hornstein <kenh@cmf.nrl.navy.mil>

   I tracked this down to code in add_to_history, in svr_principal.  This
   functions calls realloc() with a pointer to the old keys.  However, if
   there are no old keys, then realloc gets called with a NULL pointer, and
   this fails under SunOS.

   I'm not sure if it's SunOS that's broken here; certainly most other systems
   treat realloc(NULL,...) like malloc.

The ANSI C standard specifies that realloc(NULL, size) behaves like
malloc(size).  (See 7.10.3.4).  

We've had to work around this sort of bug before; we just missed this
case in the new kadmin code.  Thanks for pointing it out!

						- Ted

home help back first fref pref prev next nref lref last post