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

[Xen-changelog] [xen-unstable] libxl: Do not provide arbitrary string as format specifier to printf.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1274945212 -3600
# Node ID 946b892a8ad7ebabb40a6004ad8d883768233834
# Parent  83a3f9556a055fbb8e5484d823e0715573e24f9e
libxl: Do not provide arbitrary string as format specifier to printf.

Original patch from Dulloor <dulloor@xxxxxxxxx>
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 tools/libxl/xl_cmdimpl.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff -r 83a3f9556a05 -r 946b892a8ad7 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Thu May 27 08:21:24 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.c  Thu May 27 08:26:52 2010 +0100
@@ -3267,13 +3267,8 @@ int main_dmesg(int argc, char **argv)
     if (!cr)
         goto finish;
 
-    while (1) {
-        ret = libxl_xen_console_read_line(&ctx, cr, &line);
-        if (ret > 0)
-            printf(line);
-        else
-            break;
-    }
+    while ((ret = libxl_xen_console_read_line(&ctx, cr, &line)) > 0)
+        printf("%s", line);
 
 finish:
     libxl_xen_console_read_finish(&ctx, cr);

_______________________________________________
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®.