Skip to contentSkip to conversation

Fix buffer overflow in xenconsoled

PATCH In review Anthony Liguori 2 participants 2 messages Aug 30, 2005 – Aug 31, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix buffer overflow in xenconsoled

Appears to be a typo.

Christian's watch changes threw me off a bit as I had been pursuing another route to fix the same problems. This bug is still valid though.

Regards,

Anthony Liguori

Signed-off-by Anthony Liguori

# HG changeset patch
# User Anthony Liguori <[email protected]> # Node ID 444e4fa43bf1123873cddecff51d9fe593271eae # Parent fe6c5ecea53aabedc6b53988da25910e108eafe9 Fix overflow in reading from console

tools/console/daemon/io.c +1 -1
diff -r fe6c5ecea53a -r 444e4fa43bf1 tools/console/daemon/io.c
@@ -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;

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

Thanks!

Quoted 20 lines · Anthony Liguori

Appears to be a typo.

Christian's watch changes threw me off a bit as I had been pursuing another route to fix the same problems. This bug is still valid though.

Regards,

Anthony Liguori

Signed-off-by Anthony Liguori

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel