aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib/entropy/dev_random/dev_random.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/entropy/dev_random/dev_random.cpp b/src/lib/entropy/dev_random/dev_random.cpp
index 832424acd..ef6bceaf7 100644
--- a/src/lib/entropy/dev_random/dev_random.cpp
+++ b/src/lib/entropy/dev_random/dev_random.cpp
@@ -89,7 +89,8 @@ void Device_EntropySource::poll(Entropy_Accumulator& accum)
if(FD_ISSET(m_devices[i], &read_set))
{
const ssize_t got = ::read(m_devices[i], &io_buffer[0], io_buffer.size());
- accum.add(&io_buffer[0], got, ENTROPY_BITS_PER_BYTE);
+ if(got > 0)
+ accum.add(&io_buffer[0], got, ENTROPY_BITS_PER_BYTE);
}
}
}