Article View: comp.bugs.4bsd
Article #1354.3-tahoe random(3) bug
From: Arnold D. Robbins {EUCC}
Date: Fri, 10 Nov 1989 16:27
Date: Fri, 10 Nov 1989 16:27
39 lines
1799 bytes
1799 bytes
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
Technical Details
Message-ID:
<4569@emory.mathcs.emory.edu>Path:
arc1-ca.pugleaf.net!utzoo!attcan!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!samsung!emory!arnoldShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!samsung!emory!arnold
From: arnold@mathcs.emory.edu (Arnold D. Robbins {EUCC})
Newsgroups: comp.bugs.4bsd
Subject: 4.3-tahoe random(3) bug
Message-ID: <4569@emory.mathcs.emory.edu>
Date: 10 Nov 89 16:27:20 GMT
Organization: Math & Computer Science, Emory University, Atlanta, GA
Lines: 39