On Mon, Dec 05, 2011 at 11:22:11AM +0200, Sasha Levin wrote: > > +static int kvm_custom_stage2(void) > +{ > + char tmp[PATH_MAX], dst[PATH_MAX], *src; > + const char *rootfs; > + int r; > + > + src = realpath("guest/init_stage2", NULL); > + if (src == NULL) > + return -ENOMEM; > + > + if (image_filename[0] == NULL) > + rootfs = "default"; > + else > + rootfs = image_filename[0]; > + > + sprintf(tmp, "%s%s/virt/init_stage2", kvm__get_dir(), rootfs); > + remove(tmp); > + > + sprintf(dst, "/host/%s", src); > + r = symlink(dst, tmp); > + free(src); > + > + return r; > +} > + I might be paranoid -- but could you please use snprintf here? :) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html