From: Bernhard Kauer <kauer@os.inf.tu-dresden.de>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [Patch] set boot sequence from command line
Date: Thu, 25 Oct 2007 10:49:25 +0200 [thread overview]
Message-ID: <20071025084925.GC3182@chrom.inf.tu-dresden.de> (raw)
In-Reply-To: <20071024084611.GA10261@karma.qumranet.com>
It is perhaps not the best idea to read behind the
end of the boot_device string. It would be safer to
declare boot_device as 'static char boot_device[4]'
and use a strncpy.
Bernhard
> diff --git a/hw/pc.c b/hw/pc.c
> index a0c824f..3c552ff 100644
> --- a/hw/pc.c
> +++ b/hw/pc.c
> + /* set boot devices, and disable floppy signature check if requested */
> + rtc_set_memory(s, 0x3d,
> + boot_device2nible(boot_device[1]) << 4 |
> + boot_device2nible(boot_device[0]) );
> + rtc_set_memory(s, 0x38,
> + boot_device2nible(boot_device[2]) << 4 | (fd_bootchk ? 0x0 : 0x1));
>
> /* floppy type */
> diff --git a/vl.c b/vl.c
> index 6d8fe35..be0e06a 100644
> --- a/vl.c
> +++ b/vl.c
> + if (strlen(optarg) > 3) {
> + fprintf(stderr, "qemu: too many boot devices\n");
> + exit(1);
> + }
> + boot_device = strdup(optarg);
> + if (!strchr(boot_device, 'a') &&
next prev parent reply other threads:[~2007-10-25 8:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-24 8:46 [Qemu-devel] [Patch] set boot sequence from command line Dan Kenigsberg
2007-10-24 21:17 ` Laurent Vivier
2007-10-24 21:41 ` Anthony Liguori
2007-10-24 21:46 ` Daniel P. Berrange
2007-10-24 21:59 ` andrzej zaborowski
2007-10-24 22:15 ` J. Mayer
2007-10-25 8:49 ` Bernhard Kauer [this message]
2007-10-25 9:35 ` [Qemu-devel] [Patch] set boot sequence from command line - Take 2 Dan Kenigsberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071025084925.GC3182@chrom.inf.tu-dresden.de \
--to=kauer@os.inf.tu-dresden.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).