ia64/xen-unstable

changeset 15297:6d6b4b48773b

ioemu: save file name is snprintf()ed into a plenty big enough buffer.
From: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Fri Jun 08 19:22:08 2007 +0100 (2007-06-08)
parents b0109d3dc3dd
children 3cc79ef896a2
files tools/ioemu/target-i386-dm/helper2.c
line diff
     1.1 --- a/tools/ioemu/target-i386-dm/helper2.c	Fri Jun 08 17:37:58 2007 +0100
     1.2 +++ b/tools/ioemu/target-i386-dm/helper2.c	Fri Jun 08 19:22:08 2007 +0100
     1.3 @@ -616,7 +616,7 @@ int main_loop(void)
     1.4      extern int suspend_requested;
     1.5      CPUState *env = cpu_single_env;
     1.6      int evtchn_fd = xc_evtchn_fd(xce_handle);
     1.7 -    char qemu_file[32];
     1.8 +    char qemu_file[PATH_MAX];
     1.9  
    1.10      buffered_io_timer = qemu_new_timer(rt_clock, handle_buffered_io,
    1.11  				       cpu_single_env);
    1.12 @@ -635,7 +635,7 @@ int main_loop(void)
    1.13      main_loop_wait(1); /* For the select() on events */
    1.14  
    1.15      /* Save the device state */
    1.16 -    sprintf(qemu_file, "/var/lib/xen/qemu-save.%d", domid);
    1.17 +    snprintf(qemu_file, sizeof(qemu_file), "/var/lib/xen/qemu-save.%d", domid);
    1.18      do_savevm(qemu_file);
    1.19  
    1.20      return 0;