Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
3.8.4, 3.9.2
-
None
Description
Created for https://github.com/apache/zookeeper/pull/2097.
int seed_len = 0; /* Enter a loop to fill in seed with random data from /dev/urandom. * This is done in a loop so that we can safely handle short reads * which can happen due to signal interruptions. */ while (seed_len < sizeof(seed)) { /* Assert we either read something or we were interrupted due to a * signal (errno == EINTR) in which case we need to retry. */ int rc = read(fd, &seed + seed_len, sizeof(seed) - seed_len); assert(rc > 0 || errno == EINTR); if (rc > 0) { seed_len += rc; } }
Above code will overflow seed in case of a short read.
Attachments
Issue Links
- is caused by
-
ZOOKEEPER-2311 assert in setup_random
- Closed
- links to