diff options
Diffstat (limited to 'atomicio.c')
-rw-r--r-- | atomicio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/atomicio.c b/atomicio.c index de5363aa3..3939785df 100644 --- a/atomicio.c +++ b/atomicio.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: atomicio.c,v 1.18 2006/04/16 00:52:55 djm Exp $ */ | 1 | /* $OpenBSD: atomicio.c,v 1.19 2006/04/16 07:59:00 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2006 Damien Miller. All rights reserved. | 3 | * Copyright (c) 2006 Damien Miller. All rights reserved. |
4 | * Copyright (c) 2005 Anil Madhavapeddy. All rights reserved. | 4 | * Copyright (c) 2005 Anil Madhavapeddy. All rights reserved. |
@@ -99,7 +99,7 @@ atomiciov(ssize_t (*f) (int, const struct iovec *, int), int fd, | |||
99 | iovcnt--; | 99 | iovcnt--; |
100 | } | 100 | } |
101 | /* This shouldn't happen... */ | 101 | /* This shouldn't happen... */ |
102 | if (rem > iov[0].iov_len || (rem > 0 && iovcnt <= 0)) { | 102 | if (rem > 0 && (iovcnt <= 0 || rem > iov[0].iov_len)) { |
103 | errno = EFAULT; | 103 | errno = EFAULT; |
104 | return 0; | 104 | return 0; |
105 | } | 105 | } |