[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1318876097.23581.125.camel@mfleming-mobl1.ger.corp.intel.com>
Date: Mon, 17 Oct 2011 19:28:17 +0100
From: Matt Fleming <matt@...sole-pimps.org>
To: Maarten Lankhorst <m.b.lankhorst@...il.com>
Cc: "H. Peter Anvin" <hpa@...ux.intel.com>,
Matthew Garrett <mjg@...hat.com>, linux-kernel@...r.kernel.org,
Ingo Molnar <mingo@...e.hu>,
Thomas Gleixner <tglx@...utronix.de>, x86@...nel.org,
Mike Waychison <mikew@...gle.com>,
Andi Kleen <andi@...stfloor.org>
Subject: Re: [PATCH v5 10/10] x86, efi: EFI boot stub support
On Mon, 2011-10-17 at 18:39 +0200, Maarten Lankhorst wrote:
> > + if (options_size) {
> > + if (options_size > hdr->cmdline_size)
> > + options_size = hdr->cmdline_size;
> > +
> > + options_size++; /* NUL termination */
> > +
> > + status = low_alloc(options_size, 1, &cmdline);
> > + if (status != EFI_SUCCESS)
> > + goto fail;
> Shouldn't this be options_size + 1?
Nope. Notice the options_size++ above the allocation.
> > +
> > + s1 = (u8 *)(unsigned long)cmdline;
> > + s2 = (u16 *)options;
> > +
> > + for (i = 0; i < options_size - 1; i++)
> > + *s1++ = *s2++;
And the options_size - 1 here.
> > +
> > + *s1 = '\0';
> For this null character..
So this should all work OK.
--
Matt Fleming, Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists