summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Nugent <davidn@FreeBSD.org>1996-12-17 01:43:30 +0000
committerDavid Nugent <davidn@FreeBSD.org>1996-12-17 01:43:30 +0000
commit1996fca4773ff996ead2683db5cd8f024504a6b9 (patch)
tree306e72939381919d2a52a20e14cecbb716dc5490
parent26dd63a8c5cd4cc1b1cc41cf6c8a7b36ee3475a0 (diff)
downloadpw-darwin-1996fca4773ff996ead2683db5cd8f024504a6b9.tar.gz
pw-darwin-1996fca4773ff996ead2683db5cd8f024504a6b9.tar.zst
pw-darwin-1996fca4773ff996ead2683db5cd8f024504a6b9.zip
Submitted by: proff@iq.org
Minor fix for security patch.
-rw-r--r--pw/pw_user.c4
1 files changed, 2 insertions, 2 deletions
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 <unistd.h>
@@ -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<len;n+=16) {
u_char ubuf[16];