arnold@mathcs.emory.edu (Arnold D. Robbins {EUCC}) (11/11/89)
Subject: Bug in initstate in random.c Index: libc/random.c 4.3BSD-tahoe from UUNET a while back Description: There is a bug pointed out by Scott Garfinkle in the random.c file. This was gotten from UUNET some months back, perhaps it has been fixed since then. In initstate, if there isn't enough room, it just returns, instead of explicitly returning a null pointer. Repeat-By: Call initstate with not enough room. Fix: Apply the following patch. *** ../patch.0/missing.d/random.c Thu Apr 13 08:01:19 1989 --- random.c Fri Nov 10 10:28:46 1989 *************** *** 236,242 **** if( n < BREAK_1 ) { if( n < BREAK_0 ) { fprintf( stderr, "initstate: not enough state (%d bytes) with which to do jack; ignored.\n", n ); ! return; } rand_type = TYPE_0; rand_deg = DEG_0; --- 236,242 ---- if( n < BREAK_1 ) { if( n < BREAK_0 ) { fprintf( stderr, "initstate: not enough state (%d bytes) with which to do jack; ignored.\n", n ); ! return 0; } rand_type = TYPE_0; rand_deg = DEG_0; -- Arnold Robbins -- Emory U. Information Technology Div. | Laundry increases DOMAIN: arnold@emoryu1.cc.emory.edu | exponentially in the UUCP: gatech!emoryu1!arnold PHONE: +1 404 727-7636 | number of children. BITNET: arnold@emoryu1 FAX: +1 404 727-2599 | -- Miriam Hartholz