]> andersk Git - openssh.git/commitdiff
- djm@cvs.openbsd.org 2006/04/16 07:59:00
authordjm <djm>
Sun, 23 Apr 2006 02:06:49 +0000 (02:06 +0000)
committerdjm <djm>
Sun, 23 Apr 2006 02:06:49 +0000 (02:06 +0000)
     [atomicio.c]
     reorder sanity test so that it cannot dereference past the end of the
     iov array; well spotted canacar@!

ChangeLog
atomicio.c

index 89fce1a22df93508aefa5ef902387f187591eba8..b36cf319cf3de6a8b0e966697a711d5f217e4ed8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
      commands, which would result in a separate tiny packet on the wire by
      using atomiciov(writev, ...) to write the length and the command in one
      pass; ok deraadt@
+   - djm@cvs.openbsd.org 2006/04/16 07:59:00
+     [atomicio.c]
+     reorder sanity test so that it cannot dereference past the end of the
+     iov array; well spotted canacar@!
 
 20060421
  - (djm) [Makefile.in configure.ac session.c sshpty.c]
index de5363aa3a95d8a0a3bb34f3c563134abf5beccd..3939785df79a16e7f9f7ee376bb33683a59a8bad 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: atomicio.c,v 1.18 2006/04/16 00:52:55 djm Exp $ */
+/* $OpenBSD: atomicio.c,v 1.19 2006/04/16 07:59:00 djm Exp $ */
 /*
  * Copyright (c) 2006 Damien Miller. All rights reserved.
  * Copyright (c) 2005 Anil Madhavapeddy. All rights reserved.
@@ -99,7 +99,7 @@ atomiciov(ssize_t (*f) (int, const struct iovec *, int), int fd,
                                iovcnt--;
                        }
                        /* This shouldn't happen... */
-                       if (rem > iov[0].iov_len || (rem > 0 && iovcnt <= 0)) {
+                       if (rem > 0 && (iovcnt <= 0 || rem > iov[0].iov_len)) {
                                errno = EFAULT;
                                return 0;
                        }
This page took 0.034713 seconds and 5 git commands to generate.