diff --git a/iscsi-scst/usr/chap.c b/iscsi-scst/usr/chap.c index 287210a1f..a54309be4 100644 --- a/iscsi-scst/usr/chap.c +++ b/iscsi-scst/usr/chap.c @@ -344,7 +344,8 @@ static int chap_rand(void) fd = open("/dev/urandom", O_RDONLY); assert(fd != -1); - (void)read(fd, &r, sizeof(r)); + if (read(fd, &r, sizeof(r)) < sizeof(r)) { + } close(fd); return r; }