WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] xenconsoled: fix timestamp log

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] xenconsoled: fix timestamp log
From: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Date: Tue, 23 Jun 2009 16:49:07 +0900
Delivery-date: Tue, 23 Jun 2009 00:49:35 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
timestamp log is broken.
Also, xenconsoled might die with segfault.

Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>

diff -r 703ced548925 tools/console/daemon/io.c
--- a/tools/console/daemon/io.c Fri Jun 19 08:45:55 2009 +0100
+++ b/tools/console/daemon/io.c Tue Jun 23 16:26:36 2009 +0900
@@ -127,7 +127,7 @@ static int write_with_timestamp(int fd, 
        const char *last_byte = data + sz - 1;
 
        while (data <= last_byte) {
-               const char *nl = memchr(data, '\n', sz);
+               const char *nl = memchr(data, '\n', last_byte + 1 - data);
                int found_nl = (nl != NULL);
                if (!found_nl)
                        nl = last_byte;
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] xenconsoled: fix timestamp log, Kouya Shimura <=