Page MenuHomeFreeBSD

D8133.diff
No OneTemporary

D8133.diff

Index: lib/libc/stdlib/random.c
===================================================================
--- lib/libc/stdlib/random.c
+++ lib/libc/stdlib/random.c
@@ -270,16 +270,17 @@
srandomdev(void)
{
int mib[2];
- size_t len;
+ size_t expected, len;
if (rand_type == TYPE_0)
- len = sizeof(state[0]);
+ expected = len = sizeof(state[0]);
else
- len = rand_deg * sizeof(state[0]);
+ expected = len = rand_deg * sizeof(state[0]);
mib[0] = CTL_KERN;
mib[1] = KERN_ARND;
- sysctl(mib, 2, state, &len, NULL, 0);
+ if (sysctl(mib, 2, state, &len, NULL, 0) == -1 || len != expected)
+ abort();
if (rand_type != TYPE_0) {
fptr = &state[rand_sep];

File Metadata

Mime Type
text/plain
Expires
Sat, Apr 25, 9:03 PM (16 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32095909
Default Alt Text
D8133.diff (666 B)

Event Timeline