From 84a3d4f524c643f7087ba71f48c28ed8d72dd9f6 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Thu, 13 Jan 2005 00:37:57 +0000 Subject: [PATCH] pullup from trunk ticket: 2871 version_fixed: 1.4 git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-4@17021 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