# HG changeset patch # User Anthony Liguori # Node ID 444e4fa43bf1123873cddecff51d9fe593271eae # Parent fe6c5ecea53aabedc6b53988da25910e108eafe9 Fix overflow in reading from console diff -r fe6c5ecea53a -r 444e4fa43bf1 tools/console/daemon/io.c --- a/tools/console/daemon/io.c Tue Aug 30 22:01:01 2005 +++ b/tools/console/daemon/io.c Tue Aug 30 22:05:28 2005 @@ -353,7 +353,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;