From 871222d19d611001035d566d0ab1333849d3873e Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Thu, 13 Jan 2005 00:35:17 +0000 Subject: [PATCH] * prng.c (read_entropy_from_device): Use ssize_t, not size_t, so read() returning -1 doesn't cause trouble. ticket: 2871 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17020 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/crypto/ChangeLog | 5 +++++ src/lib/crypto/prng.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/crypto/ChangeLog b/src/lib/crypto/ChangeLog index ddcca3230..f77c170b2 100644 --- a/src/lib/crypto/ChangeLog +++ b/src/lib/crypto/ChangeLog @@ -1,3 +1,8 @@ +2005-01-12 Tom Yu + + * prng.c (read_entropy_from_device): Use ssize_t, not size_t, so + read() returning -1 doesn't cause trouble. + 2004-11-17 Ken Raeburn * prng.c (do_yarrow_init): Move mutex initialization here. diff --git a/src/lib/crypto/prng.c b/src/lib/crypto/prng.c index 7656a23aa..7371e974e 100644 --- a/src/lib/crypto/prng.c +++ b/src/lib/crypto/prng.c @@ -192,7 +192,7 @@ read_entropy_from_device (krb5_context context, const char *device) return 0; } for (left = sizeof (buf); left > 0;) { - size_t count; + ssize_t count; count = read (fd, &buf, (unsigned) left); if (count <= 0) { close(fd); -- 2.26.2