From 6f942679935ca267ade32d4e5a6bfd7d9cf26b14 Mon Sep 17 00:00:00 2001 From: David Nugent Date: Tue, 17 Dec 1996 01:43:30 +0000 Subject: Submitted by: proff@iq.org Minor fix for security patch. --- pw/pw_user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pw') diff --git a/pw/pw_user.c b/pw/pw_user.c index 150c71c..b70d68c 100644 --- a/pw/pw_user.c +++ b/pw/pw_user.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: pw_user.c,v 1.2 1996/12/11 15:10:47 joerg Exp $ + * $Id: pw_user.c,v 1.3 1996/12/16 17:37:58 davidn Exp $ */ #include @@ -771,7 +771,7 @@ pw_getrand(u_char *buf, int len) { int fd; fd = open("/dev/urandom", O_RDONLY); - if (!fd || read(fd, buf, len)!=len) { + if (fd==-1 || read(fd, buf, len)!=len) { int n; for (n=0;n