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-changelog

[Xen-changelog] [xen-unstable] xenconsole: fix assumption about printed

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xenconsole: fix assumption about printed max domid length.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 19 Jun 2009 00:56:02 -0700
Delivery-date: Fri, 19 Jun 2009 01:02:11 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1245219786 -3600
# Node ID 74911141ce79395020822deffd9a453acb70e588
# Parent  11d8ca329b5419ff48acbde150569adf27bbf474
xenconsole: fix assumption about printed max domid length.
Also snprintf includes the final '\0' in the char count.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
---
 tools/console/client/main.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff -r 11d8ca329b54 -r 74911141ce79 tools/console/client/main.c
--- a/tools/console/client/main.c       Wed Jun 17 07:22:18 2009 +0100
+++ b/tools/console/client/main.c       Wed Jun 17 07:23:06 2009 +0100
@@ -306,10 +306,10 @@ int main(int argc, char **argv)
        dom_path = xs_get_domain_path(xs, domid);
        if (dom_path == NULL)
                err(errno, "xs_get_domain_path()");
-       path = malloc(strlen(dom_path) + strlen("/serial/0/tty") + 3);
+       path = malloc(strlen(dom_path) + strlen("/serial/0/tty") + 5);
        if (path == NULL)
                err(ENOMEM, "malloc");
-       snprintf(path, strlen(dom_path) + strlen("/serial/0/tty") + 2, 
"%s/serial/%d/tty", dom_path, num);
+       snprintf(path, strlen(dom_path) + strlen("/serial/0/tty") + 5, 
"%s/serial/%d/tty", dom_path, num);
 
        /* FIXME consoled currently does not assume domain-0 doesn't have a
           console which is good when we break domain-0 up.  To keep us

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xenconsole: fix assumption about printed max domid length., Xen patchbot-unstable <=