[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Use MIN instead of MAX to avoid reading more than fits into the buffer.



# HG changeset patch
# User cl349@xxxxxxxxxxxxxxxxxxxx
# Node ID 7115d6c6c792b627fc2c561d71c765c5f0812062
# Parent  38312fe7ec38dab85c5ac7158efd776bacb44717
Use MIN instead of MAX to avoid reading more than fits into the buffer.
Signed-off-by: Anthony Liguori <aliguori@xxxxxxxxxx>
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>

diff -r 38312fe7ec38 -r 7115d6c6c792 tools/console/daemon/io.c
--- a/tools/console/daemon/io.c Wed Aug 31 08:27:34 2005
+++ b/tools/console/daemon/io.c Wed Aug 31 08:43:31 2005
@@ -371,7 +371,7 @@
                (struct ring_head *)(dom->page + PAGE_SIZE/2);
        int i;
 
-       len = read(dom->tty_fd, msg, MAX(XENCONS_SPACE(inring), sizeof(msg)));
+       len = read(dom->tty_fd, msg, MIN(XENCONS_SPACE(inring), sizeof(msg)));
        if (len < 1) {
                close(dom->tty_fd);
                dom->tty_fd = -1;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.